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,
We are changing our grid to work in ClassicPaging mode from VirtualLoad. We have a grid which have a checkbox column. We have included a "Check All" button on the client which used to use some JavaScript code to load all the records in the grid and checked all the check boxes.
Since we have changed to ClassicPaging this no longer works.
The JavaScript used when the user clicks our "Check All" checkbox is as follows:
grid.RootTable.GetRow(i).GetCell(0).GetElement().childNodes[0].checked = ischecked;
}
The problem seems to be that in this mode, TotalLoadedRows and TotalRows always seems to be the same i.e. the number of rows in each page.
Can anyone tell me how I can programmatically load all the records then manually check all the checkboxes?
We are using version 7.0.7200.301.
Regards,
Mark
Hi Andi,
Thanks for the reply. I decided another way to implement this was to change the paging mode dynamically so that I basically refresh the grid and set:
.PagingMode = PagingMode.None .StatusBarVisible = False
Then I wait on the client for the grid to reload and walk through all the rows setting the checkbox on. Seems to work really well.
Hi Mark,
If I am not mistaken, you are trying to load all the records and check all the checkboxes in classic paging ?
Here are some information about classic paging. In classic paging, the data will be rendered per page. So, if we like to check all the checkboxes, we need to load the data per page and do check them. Also, in classic paging, the cell template of checkbox will be reset after the WebGrid is refreshed or go to the next page, so we will need to use a data that consist of boolean type value and change it into a checkbox.
Here is a snippet to manually check all the checkboxes in WebGrid by rendering it page per page. As you might try, we will have a difficulty in setting update row of the WebGrid. That is why, in my snippet, I only use 5 rows per page. So ensure before you try the code, you have already changed the setting of your classic paging with 5 rows per page. And also, in here, the checkbox column's name is "Discontinued". So, to check if the checkbox is checked or not, we can simply set the value into true or false.
function Button1_onclick() { var i = 0; update(i); } function update(i) { var grid = ISGetObject("WebGrid1"); var row = grid.RootTable.GetRow(i); var cells = row.GetCells(); row.Select(); cells.GetNamedItem("Discontinued").SetText("true", true); setTimeout(function() { row.Update(); i++; if (i < grid.GetRootTable().GetRowsCount()) { update(i); } if (i == grid.GetRootTable().GetRowsCount()) { setTimeout(function() { grid.GotoNextPage(); i=0; }, 400); setTimeout(function() { update(i); }, 1000); } }, 400); }
I hope it helps and please do not hesitate to ask if you have any other questions. Thank you.
Best Regards,
Andi Santoso
Glad to hear that you have solved the problem. Please do not hesitate to ask if you have any other questions. Thank you and have a niced day.
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