EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: hande89 on July 03, 2014, 04:29:16 AM



Title: Treegrid filter
Post by: hande89 on July 03, 2014, 04:29:16 AM
http://www.jeasyui.com/extension/datagrid_filter.php

How to make this work with treegrid? I can't find any example.


Title: Re: Treegrid filter
Post by: jarry on July 04, 2014, 12:35:44 AM
The 'enableFilter' method of datagrid can also be used in treegrid. Make sure you are using the newest 'datagrid-filter.js' file. This file can be downloaded from http://www.jeasyui.com/extension/datagrid_filter.php.
Code:
$('#tg').treegrid('enableFilter', ...);


Title: Re: Treegrid filter
Post by: hande89 on July 05, 2014, 03:41:55 AM
Ok. That library is being updated quite often :)


Title: Re: Treegrid filter
Post by: hande89 on July 14, 2014, 05:53:36 AM
How to make it work with this example? http://www.jeasyui.com/easyui/demo/treegrid/clientpagination.html

If I do like this:

Code:
$(function(){
    $('#tg').treegrid().treegrid('clientPaging');
    $('#tg').treegrid('enableFilter', [{
    field:'name',
    type:'validatebox',
    op:['contains']
    }]);
})


Then the filter doesn't work and I can't use pagination or expand nodes below root level.


Title: Re: Treegrid filter
Post by: jarry on July 14, 2014, 08:10:45 AM
Please try to download the updated 'datagrid-filter.js' file from http://www.jeasyui.com/extension/datagrid_filter.php. Simply call 'enableFilter' method on the treegrid.
Code:
$('#tg').treegrid({
  pagination:true,
  remoteFilter:false,
  //...
}).treegrid('enableFilter');


Title: Re: Treegrid filter
Post by: hande89 on July 30, 2014, 02:47:46 AM
If I append node when filtering is applied and new node doesn't match to filtering, the data is displayed twice. If it matches, the node is not added.

Code:
$('#tg').treegrid('append',{data:[{"id":10,"name":"Java","persons":2,"begin":"3/11/2010","end":"3/18/2010","progress":80}]});

If I use filter and remove it, I can't append child node. Parent's icon is changed to folder but node is not added.
Code:
$('#tg').treegrid('append',{parent:3,data:[{"id":10,"name":"Java","persons":2,"begin":"3/11/2010","end":"3/18/2010","progress":80}]});


Title: Re: Treegrid filter
Post by: hande89 on August 02, 2014, 01:26:22 AM
These problems are now solved.

But I think it should handle update as well. If filtering is enabled the row should disappear if I update it so that it doesn't match filter rules anymore.


Title: Re: Treegrid filter
Post by: hande89 on September 01, 2014, 09:52:50 AM
If I enable client side sorting and click on column header, the data is displayed twice.


Title: Re: Treegrid filter
Post by: jarry on September 02, 2014, 12:41:47 AM
Please try to download the updated 'datagrid-filter.js' file from http://www.jeasyui.com/extension/datagrid_filter.php.


Title: Re: Treegrid filter
Post by: hande89 on September 02, 2014, 02:11:09 AM
Working fine :)