EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Fabrice on September 09, 2015, 06:25:14 AM



Title: datagrid filterrow and combobox
Post by: Fabrice 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).


Title: Re: datagrid filterrow and combobox
Post by: jarry on September 09, 2015, 06:57:04 AM
Do not understand this question, please describe it in more detail.


Title: Re: datagrid filterrow and combobox
Post by: Fabrice 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.



Title: Re: datagrid filterrow and combobox
Post by: Fabrice on September 17, 2015, 12:39:17 AM
Any idea?


Title: Re: datagrid filterrow and combobox
Post by: jarry 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);


Title: Re: datagrid filterrow and combobox
Post by: softboy99 on March 28, 2016, 06:49:58 PM
I also need excel like column filter, not a filter row.