PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
popup
$.popup('dbfilter', 'popupconfirm', { init : function(element) { var that = this; this.filterGrid = $('.grid', element); var that = this; PM.communication.getSchema(this.options.type, function(json) { if(!that.schema) that.schema = json; for(var i in json) { if(!json[i]) break; that.addNewRow(json[i]); } }); }, changeFieldName : function(name, tr, value) { if(value==undefined) value=''; if(!this.schema) return; var id = false; for(var i = 0;i < this.schema.length;i++) { if(this.schema[i].name == name) { id = i; break; } } if(!id) return; var type = this.schema[id].type; var value_td = $('td.value_td', tr); value_td.html(''); switch(type) { case 'string': case 'integer': var inp = $(this.options.integer_value_input); value_td.append(inp); inp.val(value); break; case 'datetime': var inp = $(this.options.datetime_value_input); value_td.append(inp); inp.datepicker({dateFormat: t('mm/dd/yy')}); inp.val(value); break; case 'list': var list = $(this.options.list_value_input); for(var i = 0;i < this.schema[id].list.length;i++) { var op = $('<option></option>'); op.val(this.schema[id].list[i].value); op.html(this.schema[id].list[i].name); list.append(op); } value_td.append(list); list.val(value); break; case 'relation': var list = $(this.options.relation_value_input); var vf = this.schema[id].value_field; var nf = this.schema[id].display_field; PM.communication.getList(this.schema[id].table, {}, function(json) { for(var i = 0;i < json.length;i++) { var op = $('<option></option>'); op.val(json[i][vf]); op.html(json[i][nf]); list.append(op); } }); value_td.append(list); list.val(value); break; } }, addNewRow : function(data) { if(!data) return; var tr = $(this.options.li); $('tbody', this.filterGrid).append(tr); var that = this; if(data) { $('span.fieldname', tr).attr('name',data.name); $('span.fieldname', tr).html(data.title); this.changeFieldName(data.name, tr, data.value); } }, onOK: function(element) { var v = this.validate(); if(v) { if(this.options.changed) this.options.changed(this.getFilterList() ); } }, getFilterList : function() { var rs = []; $('tbody tr', this.filterGrid).each(function() { var fieldname = $('span.fieldname', this).attr('name'); // var filtertype = $('.filtertype', this).val(); // var value = $.trim( $('.value', this).val() ); // var param = $.trim( $('.param', this).val() ); // var dynamic = $('.dynamic', this)[0].checked; var a = { name:fieldname, value: value}; rs.push( a ); }); return rs; } }, { li: '<tr><td><span class="fieldname"></span></td><td class="value_td"><input type="text" class="value"/></td></tr>', integer_value_input:'<input type="text" class="value"/>', datetime_value_input:'<input type="text" class="value"/>', list_value_input:'<select class="value"></select>', relation_value_input:'<select class="value"></select>', orderli:'<tr><td><select class="fieldname"></select></td><td><select class="ordertype"></select></td><td><a href="#" class="delete"><i class="font-remove"></i></a></td></tr>', addBtnClass: 'add_btn', addOrderBtnClass: 'addorder_btn', field_type: [ 'equal', 'not equal', 'less than', 'greater than', 'less or equal', 'greater or equal', 'contains', 'does not contain', 'starts with', ], functions: [ {name:' '}, {name: 'month',type:'datetime', returntype:'integer'}, {name: 'year',type:'datetime', returntype:'integer'}, {name: 'date',type:'datetime', returntype:'integer'}, ], order_type: [ 'acsending', 'descending', ], });
[+]
..
[-] profile.js
[edit]
[-] pagelist.js
[edit]
[-] order.js
[edit]
[-] customer_group.js
[edit]
[-] module_list.js
[edit]
[-] backgroundeditor.js
[edit]
[-] product.js
[edit]
[-] visualcsseditor.js
[edit]
[-] shipping_rule.js
[edit]
[-] profile_change_password.js
[edit]
[-] review.js
[edit]
[-] contributor_invite.js
[edit]
[-] dbfilter.js
[edit]
[-] tax_class.js
[edit]
[-] special_module_style_editor.js
[edit]
[-] idletimeout.js
[edit]
[-] address.js
[edit]
[-] contributor.js
[edit]
[-] login.js
[edit]
[-] skin.js
[edit]
[-] mail.js
[edit]
[-] discount.js
[edit]
[-] customer.js
[edit]
[-] productgrid.js
[edit]
[-] socialsharebuttonconfig.js
[edit]
[-] news.js
[edit]
[-] color.js
[edit]
[-] palette.js
[edit]
[-] newsgrid.js
[edit]
[-] product_option_combination_grid.js
[edit]
[-] page.js
[edit]
[-] product_option.js
[edit]
[-] tax_rate.js
[edit]
[-] coupons.js
[edit]
[-] zone.js
[edit]
[-] product_bulk_price.js
[edit]
[-] option_set.js
[edit]
[-] product_option_combination.js
[edit]