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

How to filter Grid's main datasource with list of checked items from a treeview checkbox list

2 Answers 195 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe Page
Top achievements
Rank 1
Joe Page asked on 04 Nov 2013, 02:07 AM
We have a checkbox treeview representing the company's organizational structure.
Next to the treeview, is a datagrid displaying information about the subordinates within the list of selected persons within the treeview.

A stored procedure handles all the logic for which records should be returned.
It accepts a one-column table parameter that should have one record with the id of each person selected in the treeview.

So, we need help on how to have a check/uncheck in the treeview trigger a reload of the grid.
And we want to be able to preserve the DataSourceRequest functionality handling sorting/filtering/paging/... as well.

Can someone please help us with a general idea and/or some code snippets to point us in the proper direction?
Even a very basic dropdownlist communicating to a grid would be sufficient.  We are familiar enough with jquery to bind all the nuances of the checkboxes within the treeview.

Thank you,
Joe


2 Answers, 1 is accepted

Sort by
0
Joe Page
Top achievements
Rank 1
answered on 04 Nov 2013, 01:48 PM
Also, it may help to point out that we are using Asp.net MVC 4 for our solution.
0
Petur Subev
Telerik team
answered on 05 Nov 2013, 12:27 PM
Hello Joe,

Basically how to get the checkedNodes of the TreeView is covered in this online demo:

http://demos.kendoui.com/web/treeview/checkboxes.html

You can use the exact same approach but instead of updating the list with the checkednodes on the right, you can use dataSource.read method of the Grid to rebind it each time the TreeView is checked. To actually send the checkedIDs to the server method that servers the data for the Grid you need to use the data function of the dataSource.

Check the following example how to send parameters using the data function of the read configuration:

http://docs.kendoui.com/api/framework/datasource#configuration-transport.read.data

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
Joe Page
Top achievements
Rank 1
Answers by
Joe Page
Top achievements
Rank 1
Petur Subev
Telerik team
Share this question
or