EasyUI Forum
November 04, 2025, 10:39:21 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: apply filters on a column of treegrid.  (Read 10034 times)
arawak
Newbie
*
Posts: 15


View Profile
« 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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.
Logged
arawak
Newbie
*
Posts: 15


View Profile
« Reply #2 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  Huh
« Last Edit: September 17, 2014, 08:32:57 AM by arawak » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!