EasyUI Forum
May 05, 2024, 07:47:05 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Some questions about filters  (Read 8036 times)
A-K
Full Member
***
Posts: 122


View Profile WWW
« on: November 27, 2014, 12:39:28 PM »

Hey,
I wanted to know why everytime that I need to change properties in the datagrid that requires
to call the datagrid constructor like this code:
Code:
$('#dg').datagrid({
        nowrap: false,
        autoRowHeight: true
    });

it requires me to configure the filters again. Why does it remove the filters from the table?

Also, why when calling
Code:
$('#dg').datagrid('removeFilterRule');

it does not return the data without the filters? I cannot reload at some points and if I need to remove the current filter
I cannot get back the data.

Thanks!
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: November 27, 2014, 06:39:40 PM »

When calling '.datagrid({...})', the datagrid will be re-created. After created a datagrid, the user must call 'enableFilter' method again to create and enable filter functionality.
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #2 on: November 28, 2014, 12:55:25 AM »

Thanks for the replay, and also what about this code:

Code:
$('#dg').datagrid('removeFilterRule');

It only deletes the filter but the data remains the same, this isnt really helping and it looks like a bug,
Why when removing the filter it doesnt return back the data without the filters? just like manually deleting the filter.


and is there a way to achieve
Code:
$('#dg').datagrid({
        nowrap: false,
        autoRowHeight: true
    });
 without re-creating the datagrid? he is created with nowrap: true and autoRowHeight: false and I need to dynamically change this properties.

Thanks!
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: November 28, 2014, 01:13:52 AM »

After removing a filter rule, you can call 'doFilter' method to force the datagrid to refresh the data.
Code:
$('#dg').datagrid('removeFilterRule');
$('#dg').datagrid('doFilter');
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!