iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
I want a loop over all rows on Client Side. I have write following code:
for (var k = 0; k < grdComputerLine.RootTable.GetRowsCount(); k++) { if (grdComputerLine.RootTable.GetRow(k).Type == "Record") { // do something... } }
But GetRowsCount works not correct if there are pending changes (Batch Update Mode).
Please have a look on attached pictures.
Regards
Michael
In a grouped WebGrid you will need to iterate the TR element and get the row object of each TR element which has the Record type in order to retrieve all the IDs. Here is the snippet:
var grid = ISGetObject("grdObj");var Message = "";var tbl = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE);var rowList = tbl.getElementsByTagName("tr");for (var i = 0; i < rowList.length; i++) { var tr = rowList[i]; if (tr.getAttribute("type") == "Record") { Message += grid.GetRowByElement(tr).GetCell("id").Text + "\n"; }}alert(Message);
Regarding the GetCheckedRows issue, we are not able to replicate it in our environment. Under group or ungroup WebGrid the GetCheckedRows function will always return the correct collection of checked TR element in the WebGrid.
We have successfully replicated the issue in our environment. A bugreport has been submitted to our developer. We will inform you if there is any update or progress regarding this issue.
Hi Glenn
Please check also this behavior:
I use following test code:
var Message = ""; for (var k = 0; k < 5; k++) { Message += grdComputerLine.RootTable.GetRow(k).GetCell("ID").Text + "\n"; } alert(Message);
If the WebGrid is not grouped I get all IDs in correctly order (see ForEach.jpg).
If the WebGrid is grouped I get only 3 IDs (see ForEachGrouped).
How can I get all IDs, if the WebGrid are grouped?
By the way: RootTable.GetCheckedRows() also doesn't work correctly. It seems to be the same problem...
Thanks for snippet. It works fine!
About GetCheckedRows issue:
I had set AllowMultipleSelection = MultipleSelection.Yes
That was the reason why it does not work correctly!
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