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

Hierarchy Grid not Expanding

1 Answer 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 20 Jun 2014, 09:10 PM
I am using a kendo hierarchy grid in a rails project the gird has 3 levels.  I am also using a tab strip but the tab strip is not connected to the grid at all.  Basically what I am doing is each time a tab is clicked I am reloading the grid with different ids in the loadGoalTable function.  The first tab loads gird fine and the hierarchy grid is working correctly.  But when I click the second tab the loadGoalTable function is triggered with new ids but the the top level of the grid will not expand.  The ids are changing and the new data is getting read in but the rows of the grid will not expand.  I have tried manually refreshing the grid using .read() but that does not work either.  Also I am not getting any errors.  I am really stuck this and can not figure out the problem.  Any help would be really appreciated.  Below is a gist to the code.

https://gist.github.com/sdanko11/fb2e92a823afa69d1d7f

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 24 Jun 2014, 01:40 PM
Hello Steve,

In your current approach the Grid is initialized multiple times which is not supported. Instead of calling loadGoalTable each time the TabStrip's selection changes please consider refreshing it with the read method.
In order to change the url parameters you should define the transport.read.url as a function and pass the parameters through the read method. For example:

$("#tabstrip").kendoTabStrip({
  select: onSelect,
});
 
function onSelect(e) {
  var marketId = $(e.item).attr('market-id');
  var grid = $("#grid").data("kendoGrid");
 
  grid.dataSource.read({ campaignId: campaignId, marketId: marketId });
}
 
//initialize the Grid


Regards,
Alexander Valchev
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
Steve
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or