EasyUI Forum
March 28, 2024, 01:01:36 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: datagrid + filterRules  (Read 3495 times)
rezzonico
Full Member
***
Posts: 182


View Profile
« on: April 09, 2018, 08:51:09 AM »

Hi all,

I need to reload a datagrid and pass the filterRules.
Here is my code:

Code:
                          url = 'prog.cgi?filterRules=[{field:"Active",value:"1"}]',
                           $(this).combogrid('grid').datagrid('reload', url);

The problem is that at the server site I receive the following error:

Code:
unexpected end of string while parsing JSON string, at character offset 3 (before "ield:"Active",value:...") at

Regards.
Miche


Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 09, 2018, 07:38:24 PM »

You should stringify your object before sending to the server.
Code:
var rules = JSON.stringify([{field:"Active",value:"1"}]);
...

If you are using the 'datagrid-filter.js' extension, set the 'remoteFilter' property to true to filter rows on the server. Please look at this example https://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=material&dir=ltr&pitem=Remote%20Filtering%20on%20DataGrid&sort=
Logged
rezzonico
Full Member
***
Posts: 182


View Profile
« Reply #2 on: April 10, 2018, 04:47:29 AM »

Thanks !

Miche
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!