I am using the ighierarchical grid.
I am finding it difficult to access the parent grid row for a Child grid when Adding a new record to the child.
There is a primary key - foreign key relationship between parent and child defined on the grid.
I need to access value(s) on the parent before I can create a new record on the child.
Can someone advise?
Thank You
hi,
there are several ways to achieve this. One way would be to handle the expanding / expanded event for rows:
$("#grid1").bind({ ighierarchicalgridrowexpanded: function (e, args) {
var parentID = args.parentrow.attr("data-id");
});
Or if you have the child grid, you can get its parent in the following way:
var id = $("#childGridElement").closest("tr").prev().attr("data-id");
This will get the parent TR container of the child grid, and then get the previous sibling, which is the actual parent data row, which was expanded.
Hope it helps.
Thanks,
Angel
How would you get the parent from a controller (mvc) with ig_transactions?