I want to create columns dynamically on igHierarchicalGrid with LoadOnDemand option. First, I want to show records of parent grid returned by a stored procedure. Then by clicking (+) sign, I want to call another stored procedure which will return dynamic columns according to the Primary key of Parent grid. Following is the code I tried in Javascript but it is not showing columns and data of Parent grid.
var actionUrl = '@Url.Action("ActionName", "ControllerName")'; var actionUrl2 = '@Url.Action("ActionName", "ControllerName")'; $(gridId).igHierarchicalGrid({ initialDataBindDepth: 0, loadOnDemand: true, renderCheckboxes: true, dataSource: actionUrl, dataSourceType: "json", responseDataKey: "Source", autoGenerateColumns: true, autoGenerateLayouts: true, primaryKey: "KeywordID", defaultColumnWidth: "100px", width: "100%", height: "420px", columnLayouts: [ { dataSource: actionUrl2, key: "pagedList", dataSourceType: "json", responseDataKey: 'Source', autoGenerateColumns: true, primaryKey: "KeywordId", foreignKey: "KeywordID" } ] });
Both actions are returning json type data source.
Please suggest for the above code or provide a reference for generating igHierarchicalGrid with dynamic columns.
Hello Far,
Thank you for posting in our forums!I do not have a clear understanding of what type of dynamic columns you are trying to display. And from the code you provided, I cannot determine why the parent grid is not displaying data.To better assist you with this, please provide a simple sample that reproduces the issue you are seeing. Also provide me with the steps to reproduce so I may better understand the issue.