Hi,
I've just started using igHierarchicalGrid...I have different problems, but some of them are all related to one thing: discriminate parent grid from child grid.I can explain it better with a sample. I put igUpdating, with RowEditTemplate, on both grids, parent and child. How can I separate the 2 different things? If I intercept, from javascript code, the iggridupdatingroweditdialogcontentsrendered event, I am only able to define it in the following way:
$("#parent_grid").live('iggridupdatingroweditdialogcontentsrendered', function (event, ui) { ... });
But I am not able to define, for example:
$("#child_grid").live('iggridupdatingroweditdialogcontentsrendered', function (event, ui) { ... });
Or something like:
$("#child_grid").live('ighierarchicalgridupdatingroweditdialogcontentsrendered', function (event, ui) { ... });
Even if I defined on the child grid the child_grid ID.
Of course this is not only related to RowEditTemplate. For example I have to manage also hiding feature. A stupid sample could be: "pressing a button I would like to show a hidden column of the child grid". I do it in the following way:
function buttonClicked() { $("#child_grid").igGridHiding("showColumn", "Description"); }
But nothing happened, even if console does not give me any kind of error...
So, my question is simple: how to determine if an event happened on the parent grid or on the child grid (first sample)? Or, same thing, how to specify function only for the child grid and not for the parent grid (second sample)?
Thanks
Flavio
This is very good. But I still have some problems...Look at this sample:
$("#parent_grid").live('iggridupdatingroweditdialogcontentsrendered', function (event, ui) { alert(1); }); $("table[id^=parent_grid_]").live("iggridupdatingroweditdialogcontentsrendered", function (event, ui) { alert(2); });
If I open the rowEditDialog of a "parent row" I have the popup 1 on my screen.But if I open rowEditDialog of a "child row" I have the popup 1, and then the popup 2 on my screen.What I was looking for is a complete separated behavior. I would like to see 1 if I work on parent rows, and only 2 if I work on children ones.Of course I can insert some code like:
if(event.target.id contains child){ ...it is something related to the children }
But I think it is too boring...I thought there was something to completely distinguish between the 2 grids...
Hello Flavio,
There isn't descrimination of any king in the igHierarchicalGrid.
Every of the child grids is igGrid per se.
Using "child_grid" you just specify the key of the column layout which is not the id of the child grid
The key is generated in the code snippet from the help link below:
http://help.infragistics.com/Help/NetAdvantage/jQuery/2012.2/CLR4.0/html/jQuery_igHierarchical_Grid_Selecting_and_Deselecting_Rows_and_Cell_Programmatically_in_igHierarchicalGrid.html#_Ref321748265
You may handle the event only for the child grids using the following way:
$("table[id^=grid1_]").live("iggridupdatingroweditdialogcontentsrendered", function (evt, ui) {
});
Hope this helps.