EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: arawak on September 17, 2014, 06:59:59 AM



Title: apply filters on a column of treegrid.
Post by: arawak on September 17, 2014, 06:59:59 AM
hello,
I would like to apply filters on a column of treegrid.
I downloaded and set the filter as follows the current version of "datagrid-filter.js" on http://www.jeasyui.com/extension/datagrid_filter.php:
Code:
$(this).treegrid('enableFilter',[
{
    field:'serStatut',
    type:'combobox',
    options:{
    panelHeight:'auto',
    data:[{value:'',text:'Tous'},{value:'0',text:'Non'},{value:'1',text:'Oui'}],
    onChange:function(value){
        if (value == ''){
        $(this).treegrid('removeFilterRule', 'serStatut');
        } else {
        $(this).treegrid('addFilterRule', {
                field: 'serStatut',
                op: 'equal',
                value: value
            });
        }
        $(this).treegrid('doFilter');
                    }
}
}]);
At runtime, the following error message appears:
Code:
TypeError: $.data(...) is undefined
var _6e1=$.data(jq[0],"datagrid").options;

Can you help me?
thank you


Title: Re: apply filters on a column of treegrid.
Post by: stworthy on September 17, 2014, 08:10:51 AM
In the 'onChange' event of the combobox, the this indicate the combobox not the treegrid. You have to use your treegrid selector instead.


Title: Re: apply filters on a column of treegrid.
Post by: arawak on September 17, 2014, 08:27:59 AM
thank you,
Yet I looked for a long time ...
Correction made​​, it works, but as the combobox does not retain the selected value, the loop function ...

Question: where to find documentation "doFilter"?

A little help ...
Sorry to be so null  ???