Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Bind child grid of igHierarchicalGrid with stored procedure
posted

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.

Parents
No Data
Reply
  • 7315
    Offline posted

    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.

Children
No Data