This is a migrated thread and some comments may be shown as answers.

Filter the filter dropdown list based off grid datasource

2 Answers 299 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 22 Apr 2014, 07:28 PM
This seems like a simple one but I am having issues finding a fix.  On window, I have 4 dropdowns and a grid.  A person can select from the dropdown and that will filter the grid.  Now that you have a filtered grid, you can then click on the grid column to filter at the column level.  The issue is that the dropdown list on the grid column filter does not reflect the filtered grid results.  Basically it is still the full potential list of choices instead of the reduced list since the grid was filtered.

So, how does one call a function to change the column filter datasource and
how do you get the now reduced datasource from the column?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Adam
Top achievements
Rank 1
answered on 22 Apr 2014, 07:39 PM
Another potential is if there can be some event that know the grid data has changed and calls an ajax call to filter the filter dropdown list.
Ex)
{
    field: "Name", title: "Name", width: "130px",
    filterable: { ui: FilterOption }
}

With.
function FilterOption (element) {
  // send the field id in resquest data;
  element.kendoDropDownList({
  dataSource: {//send Ajax request},
  optionLabel: "--Select Value--"
 });
}


0
Petur Subev
Telerik team
answered on 24 Apr 2014, 01:29 PM
Hello Adam,

Basically you should use the change event of the DropDownList to rather call the read method or the filter method of the Grid's dataSource. if using the read method you will have to also specify data function to send the values of those 4 DDLs as extra parameters.

Check the examples here and here.

To get the values of the DropDownLists you should use their value methods.

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Adam
Top achievements
Rank 1
Answers by
Adam
Top achievements
Rank 1
Petur Subev
Telerik team
Share this question
or