EasyUI Forum
May 08, 2024, 11:24:09 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: Dynamic filter  (Read 6446 times)
acreonte82
Jr. Member
**
Posts: 85



View Profile
« on: February 25, 2014, 10:54:03 AM »

Hi stworthy,
I've an easy request , I hope  Grin

In my application I created a js script that retrive data from server and build a dynamic datagrid.
(here my old post http://www.jeasyui.com/forum/index.php?topic=2197.0).

My question is: how I can build dynamic filter (combobox with checkbox) for each columns and, for each filter columns, a grouping of value for that column?

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


View Profile Email
« Reply #1 on: February 25, 2014, 07:01:46 PM »

Before enabling filter, the filter configuration must be ready. Thus you need to read these information from server and then build the data that looks like this:
Code:
var filterConf = [{
field:'listprice',
type:'numberbox',
options:{precision:1},
op:['equal','notequal','less','greater']
},{
field:'unitcost',
type:'numberbox',
options:{precision:1},
op:['equal','notequal','less','greater']
}]

Finally call 'enableFilter' method with 'filterConf' parameter value.
Code:
$('#dg').datagrid('enableFilter', filterConf);
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!