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 have a webgrid, with a rowchecker column. I am trying to delete all of the checked rows from the grid on the client side. There is no data updating required at this stage, just deleting from the grid. However, I only seem to be able to get the first checked row to delete.
Here is the relevant code from my javascript function:
{
}
Has anyone got any idea why this migh not be working for me?
thanks
The above code will not work because Delete function is a asynchronous call. You will need to modify the code to allow the call to be completed and invoking another delete afterward. Here is the modified snippet:
var i = 0;var intervalObj;function DeleteRow(){ var grid = ISGetObject("grdObj"); var checkedRows = grid.RootTable.GetCheckedRows(); if (checkedRows.length > 0) { intervalObj = setInterval(function() { if (!grid.IsInProgress) { if(i < checkedRows.length) { var htmlRow = grid.RootTable.GetCheckedRows()[0]; var wgRowObject = grid.RootTable.ToRowObject(htmlRow); if (wgRowObject.KeyValue != '') wgRowObject.Delete(); i++; } if (i >= checkedRows.length) { clearInterval(intervalObj); intervalObj = null; i = 0; } } }, 5); }}
Thanks Glenn, that makes sense, and has solved my problem.
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