diff --git a/js/legacy/widgets/listing.js b/js/legacy/widgets/listing.js index 1873271eb1..fa5fc47909 100644 --- a/js/legacy/widgets/listing.js +++ b/js/legacy/widgets/listing.js @@ -239,7 +239,7 @@ Listing.prototype.add_filter = function(label, ftype, options, tname, fname, con //if(!inp.input.custom_select && !inp.input.txt) // $y(inp.input,{width:'100%'}); - inp.tn = tname; inp.fn = fname; inp.condition = cond; + inp.tn = tname; inp.fn = fname; inp.condition = ftype=='Data' ? 'like' : cond; var me = this; inp.onchange = function() { me.start = 0; } diff --git a/js/legacy/wnf.compressed.js b/js/legacy/wnf.compressed.js index 69359c6786..997f89695f 100644 --- a/js/legacy/wnf.compressed.js +++ b/js/legacy/wnf.compressed.js @@ -362,7 +362,7 @@ $ds(this.filter_wrapper);if((!this.inp_tab)||(this.cell_idx==this.filters_per_li this.cell_idx=0;} var c=this.inp_tab.rows[0].cells[this.cell_idx];this.cell_idx++;$y(c,{width:cint(100/this.filters_per_line)+'%',textAlign:'left',verticalAlign:'top'});var d1=$a(c,'div','',{fontSize:'11px',marginBottom:'2px'});d1.innerHTML=label;if(ftype=='Link')d1.innerHTML+=' ';var d2=$a(c,'div');if(in_list(['Text','Small Text','Code','Text Editor','Read Only'],ftype)) ftype='Data';if(ftype=='Select'&&!in_list(options.split('\n'),''))options='\n'+options -var inp=make_field({fieldtype:ftype,'label':label,'options':options,no_buttons:1},'',d2,this,0,1);inp.not_in_form=1;inp.report=this;inp.df.single_select=1;inp.parent_cell=c;inp.parent_tab=this.input_tab;$y(inp.wrapper,{width:'95%'});inp.refresh();inp.tn=tname;inp.fn=fname;inp.condition=cond;var me=this;inp.onchange=function(){me.start=0;} +var inp=make_field({fieldtype:ftype,'label':label,'options':options,no_buttons:1},'',d2,this,0,1);inp.not_in_form=1;inp.report=this;inp.df.single_select=1;inp.parent_cell=c;inp.parent_tab=this.input_tab;$y(inp.wrapper,{width:'95%'});inp.refresh();inp.tn=tname;inp.fn=fname;inp.condition=ftype=='Data'?'like':cond;var me=this;inp.onchange=function(){me.start=0;} this.filters[label]=inp;this.filter_set=1;} Listing.prototype.remove_filter=function(label){var inp=this.filters[label];inp.parent_tab.rows[0].deleteCell(inp.parent_cell.cellIndex);delete this.filters[label];} Listing.prototype.remove_all_filters=function(){for(var k in this.filters)this.remove_filter(k);$dh(this.filter_wrapper);}