Firstly I have made a Kendo grid. Each row of the grid has a button on it, which on-click opens a Kendo template (pop-up). still here it's fine.
Is it possible to add another grid in the popup and add editable child items(like grid hierarchy) to each grid row?
This is my main grid:
var grid= $("#Grid").kendoGrid({
columns: [
{ field: "Name", title: "Name" },
{ field: "Description", title:"Description"},
{ field: "Remarks", title:"Remarks" },
{ command: { name: "details", text: "....", click: showDetails }, title: "Button", attributes: {
style: "text-align: center;"
}
},
{field:"Status",title:"Status"},
],
{......... data source and irrelevant code }
});
Code for window pop-up and button on-click function:
wnd = $("#details")
.kendoWindow({
title: "Details",
modal: true,
visible: false,
resizable: false,
width: 400,
height:600
}).data("kendoWindow");
detailsTemplate = kendo.template($("#template").html());
});
function showDetails(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
wnd.content(detailsTemplate(dataItem));
wnd.center().open();
}
Code for template look like:
<script type="text/x-kendo-template" id="template">
<div id="details-container">
<dl>
<dt id="fac">Fan: </dt>
<dt id="gc"> AC </dt>
<dt id="pn"> Name: </dt>
<dt id=pk> #=Name# </dt>
<dt id="sn">Status: </dt>
<dt id=sk> #=Status# </dt>
</dl>
<br />
<div class="rowdiv">
<div id="windowgrid"></div>
<!-- windowgrid is another grid which I need to get from this template, it is not displaying the grid but give a space in between -->
</div>
<br />
<button id="bbb3" class="button">Cancel</button>
<button id="bbb2" class="button">Save</button>
<button id="bbb1" class="button">Refresh </button>
</div>
</script>
The div tag including window grid is not displaying the grid but displaying remaining other things. can you suggest what mistake I have done in the code Secondly, Can you help me with the code to get a child row for each grid row.
Thank you
EDIT This is the dojo link of whole code: http://dojo.telerik.com/igOroG