I'm working on a project which uses a button to open a kendo window. Inside this kendo window is a splitter which splits the window vertically 50%. On the left side is a kendo treeview control and on the right, a gridview will appear via the treeview's select event. This works but only once. I then have to refresh the page to get it to work again. I'm not sure why this is. I'll include some example code below. Thank you for your help.
Here's the HTML for the window and the grid
<div id="example"> <div id="window"> <div id="horizontal" style="height: 100%; width: 100%;"> <div id="left-pane"> <div class="component-tree-view k-content"> <div id="treeview-left"></div> </div> </div> <div id="grid"> </div> </div> </div></div>
This is the javascript to initialize the the splitter and the window
$(document).ready(function() { $("#horizontal").kendoSplitter({ panes: [ { collapsible: true }, { collapsible: false }, { collapsible: true } ] }); var myWindow = $("#window"); myWindow.kendoWindow({ width: "1500px", title: "Parts Group", height:"500px", visible: false, actions: [ "Close" ], }).data("kendoWindow").center().open(); });
And this is my select event for the treeview to initialize the grid.
function onselect(e) { //initializing the grid here $("#grid").kendoGrid({ toolbar: [ { template: kendo.template($("#template").html()) } ], dataSource: { data: filteredData, schema: { model: { fields: { ComponentId: { from: "ComponentId", filterable: true, }, Description: { from: "Description", filterable: true, } } } } }, selectable: true, change: onChange, allowCopy: true, height: 500, scrollable: false, sortable: true, refresh: true, columns: [ { field: "ComponentId", title: "Component Id", template: "#=test(data)#", filterable: true }, { field: "Description", title: "Description", template: "#=description(data)#", filterable: true } ], }); }
