EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: zmxtcc on August 18, 2014, 05:38:28 PM



Title: How the datagrid "addFilterRule" when or before "enableFilter"?
Post by: zmxtcc on August 18, 2014, 05:38:28 PM
my datagrid should be "remoteFilter: true"

if i do like this:
var dg = $('#dg').datagrid({
            ........
            url: '/test',
            method: 'post',
            remoteFilter: true,
            ................
});
dg.datagrid('enableFilter');
dg.datagrid('addFilterRule', {
            field: 'Status',
            op: 'equal',
            value: 'OK'
});

it will post two times.data(all) 1st time,and data(Status=='OK') 2nd time.
and this do not work well,it cant filter sometimes
so i want to "addFilterRule" when or before "enableFilter"