Title: Datagrid row filter - default filterRules not working first remote call Post by: Stefan B. on July 01, 2014, 04:56:41 AM Working with remote filter and if I define default filterRules for an datagrid, this filter rule not working on the first fetching of data (all data shown).
If I click then the refresh button on pagination the filter works! Code: $('#dg').datagrid({ Title: Re: Datagrid row filter - default filterRules not working first remote call Post by: jarry on July 01, 2014, 08:48:58 AM To solve this issue, please download the updated 'datagrid-filter.js' file from http://www.jeasyui.com/extension/datagrid_filter.php
Title: Re: Datagrid row filter - default filterRules not working first remote call Post by: Stefan B. on July 01, 2014, 11:53:37 PM Thx, but this don't fix the problem.
Now the filter value is shown in the filter row, but when the page with the datagrid load the first time the data are not filtered! On remote server side the request parameter of the FilterRules is a null object. When I refresh the datagrid over the pagination after the first loading, then the data filtered correct. Title: Re: Datagrid row filter - default filterRules not working first remote call Post by: jarry on July 02, 2014, 12:30:57 AM The 'filterRules' parameter value does not sent to server before calling 'enableFilter' method. In order to force the datagrid to do the filter action, please call 'doFilter' method after calling 'enableFilter' method.
Code: $('#dg').datagrid('enableFilter',...).datagrid('doFilter'); Title: Re: Datagrid row filter - default filterRules not working first remote call Post by: Stefan B. on July 02, 2014, 02:57:49 AM OK, but I never call "doFilter" direct. This is every time handle by the extension or datagrid. I don't know this.
And it's look like that the datagrid not used the filter when first loading the data by AJAX over the settings Code: pagination: true, I mean if the filterRules is init, the datagrid should use this filter when first starting to fetch the data from the remote server over the url! We will prefilter the data from the database by this field. Like that the datagrid should only show datasets for a special server. |