EasyUI Forum
May 17, 2024, 07:04:33 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: datagrid filterrow and combobox  (Read 8536 times)
Fabrice
Jr. Member
**
Posts: 62


View Profile
« on: September 09, 2015, 06:25:14 AM »

Is-it possible to dynamicaly fill a combobox in a filterrow with the content of the datagrid like Excel each time i load datas?

for example, i have 4 rows :
Number, name
1          Smith
2          John
3          Smith
4          John
In the filter row i want for the first column (1, 2, 3, 4 with checkboxes if possible) and for the second column (All, Smith, John with checkboxes if possible).
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: September 09, 2015, 06:57:04 AM »

Do not understand this question, please describe it in more detail.
Logged
Fabrice
Jr. Member
**
Posts: 62


View Profile
« Reply #2 on: September 14, 2015, 01:05:31 AM »

Sorry for my bad explication!

in a datagrid, when i use enableFilter to display filterrow, i want that in the filtercell for each columns a combobox filled with all distincts elements found on all the datas for this column, a checkbox displayed before each item of the combobox, a "Ok" button and a "Cancel" button.
In my previous example, if i open the second combobox in the filterrow, i must see : "Select All", "Smith" and "John", if i check "Smith" and click "Ok", only rows with "Smith" in there field "name" must appears.
And i want that the content of the combobox to be refreshed when i call "loaddata" method of the datagrid.

It's look like option "Datas/Filter" in Microsoft Excel.

Logged
Fabrice
Jr. Member
**
Posts: 62


View Profile
« Reply #3 on: September 17, 2015, 12:39:17 AM »

Any idea?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #4 on: September 17, 2015, 04:52:41 AM »

You can call 'getFilterComponent' method to get the filter combobox and then reload the combobox data.
Code:
var cc = $('#dg').datagrid('getFilterComponent', 'status');
cc.combobox('loadData', data);
Logged
softboy99
Newbie
*
Posts: 43


View Profile Email
« Reply #5 on: March 28, 2016, 06:49:58 PM »

I also need excel like column filter, not a filter row.
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!