Hi Guyot,
We have prepared the work around and rendered the details template with different data source by using “detailsDataBound” client side event in TreeGrid.
Please find the code example below:
<ej:TreeGrid ID="TreeGridcontainer" runat="server"
DetailsTemplate="descriptionTemplate"
ShowDetailsRowInfoColumn="false"
ShowDetailsRow="true"
DetailsDataBound="databound">
</ej:TreeGrid>
<script id="descriptionTemplate" type="text/x-jsrender">
<div id="container{{:Id}}"></div>
</script>
<script type="text/javascript">
//Separate data source for resources
var resources = [];
var x = 0;
for (var i = 0; i < 16; i++) {
var parent = {};
parent["Id"] = ++x;
parent["Name"] = "Resource " + x;
resources.push(parent);
}
function databound(args) {
for (var i = 0; i < resources.length; i++) {
if (resources[i].Id == args.data.Id) {
//we can append the required data to details template from here
$("#container" + args.data.Id).append(resources[i].Name);
}
}
}
</script> |
We have also prepared the sample based on this. And fetched the required resource name [separate datasource] for each task by comparing its Id value with TreeGrid Id value. And appended the obtained resource in a details template. Please find the sample from below location
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, we must include Syncfusion.EJ and Syncfusion.EJ.Web dlls to render the TreeGrid control which is available in Essential Studio installed location.
Please let us know if you require further assistance on this.
Regards,
Jone sherine P S