EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: A-K on July 08, 2015, 10:55:51 PM



Title: Filters on columns with formatters
Post by: A-K on July 08, 2015, 10:55:51 PM
Hey,

How can I make the filters to work on columns with formatters? I prefer having this with the fast filter that filters when you type.

Also, can I show the filter only on specific columns and not all of them when "enable: Filter" is added?

Thanks!


Title: Re: Filters on columns with formatters
Post by: stworthy on July 09, 2015, 07:24:16 AM
To hide the filter, just set the filter type to 'label', or set the 'defaultFilterType' property to 'label' and enable what fields you want to filter.
Code:
var dg = $('#dg').datagrid({
defaultFilterType:'label'
});
dg.datagrid('enableFilter', [{
field:'listprice',
type:'numberbox',
options:{precision:1},
op:['equal','notequal','less','greater']
},{
field:'unitcost',
type:'numberbox',
options:{precision:1},
op:['equal','notequal','less','greater']
},{
field:'attr1',
type:'label'
},{
field:'status',
type:'label'
}]);


Title: Re: Filters on columns with formatters
Post by: A-K on July 09, 2015, 08:39:03 AM
Works great!

Can you also tell me how to make the filter to work on columns with formatters? This is my main issue.

Thanks.


Title: Re: Filters on columns with formatters
Post by: A-K on July 11, 2015, 12:47:32 AM
stworthy, Could you help out with this?


Title: Re: Filters on columns with formatters
Post by: stworthy on July 11, 2015, 02:45:49 AM
Please try to download the 'datagrid-filter.js' file from http://www.jeasyui.com/extension/datagrid_filter.php


Title: Re: Filters on columns with formatters
Post by: A-K on July 11, 2015, 02:53:09 AM
Thanks! I didnt know you updated the filters to work on formatters.