EasyUI Forum
October 12, 2025, 04:15:45 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: Can I filter a datagrid column with SQL?  (Read 8598 times)
gib65
Newbie
*
Posts: 29


View Profile Email
« on: March 07, 2017, 11:51:14 AM »

Hello,

I'm experimenting with filtering on the EasyUI datagrid. I'm wondering if the API has any functions for filtering that can handle SQL string, at least a WHERE clause.

For example, if Status is one of the columns:

dg.datagrid("addFilterRule", "WHERE Status = 'N'");

Is there anything like this in the API?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 07, 2017, 05:07:20 PM »

Please look at this topic https://www.jeasyui.com/forum/index.php?topic=3710.0
Logged
gib65
Newbie
*
Posts: 29


View Profile Email
« Reply #2 on: March 08, 2017, 11:24:07 AM »

Thanks for the article stworthy,

By the sounds of it, it seems like I'd have to convert the json string that the filter gives me and programmatically convert it to SQL.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: March 09, 2017, 03:51:14 AM »

The datagrid sends the filter rules to server. You must decode it and convert to the SQL according to your database. Please refer to this example https://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=Remote%20Filtering%20on%20DataGrid
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!