iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I have a hierarchical table structure in my WebGrid where there is one RootTable and one ChildTable. I want to iterate through all rows of my child table to look for certain "StatusID" column values and if found set the WebGrid to automatically refresh after a set period of time, when I will perform the check again.
The code I have written is as follows:
var grid = ISGetObject("grdEDMPortfolios"); var childRows = grid.RootTable.ChildTables[0].Rows; for(var i = 0; i < childRows.length; i++) { alert(childRows[i].GetCells().GetNamedItem("StatusID").Value); }
This does not work however since the "ChildTables[0].Rows" property never returns the child rows as described in your WebGrid documentation, it always returns null.
Is this a bug? And how do I do this without have to iterate though each RootTable row then having to get each child row which seems like overkill.
Regards,
Adrian.
Yudi,
Thanks of the response. I've worked around the issue of the ".Rows" property of the WebGridTable always being null (seems kind of pointless to document this property if it doesn't actually work) but my solution is similar to yours in that I have to iterate through all the RootTable rows and call GetChildRows() methods.
for(var i = 0; i < totalRows; i++) { var childRows = grid.RootTable.GetRow(i).GetChildRows(); for(var j = 0; j < childRows.length; j++) { if(childRows[j].GetCells().GetNamedItem("StatusID").Value != 352 && // Completed childRows[j].GetCells().GetNamedItem("StatusID").Value != 353 && // Failed childRows[j].GetCells().GetNamedItem("StatusID").Value != 354) // Peril not found. { window.setTimeout("WebGrid_RefreshGrid('grdEDMPortfolios');", 15000); return; } } }
I’d like to suggest you a better way to get the child row by using GetChildRows object based on defined relations.Example:
... var childRows = row.GetChildRows("Orders"); ...
Hope this helps.
Glad to hear that the information helps.
Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname