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
I have a grid with a IsRowChecker column and i want to access a particular value on client side, for all the checked rows. When the user check a individual row the following code works fine. But when the user check all the rows with the checkbox in the row header, the cellValue property is undefined. How can i access the cell value? (The cell text and value must be differents)
/// Javascript functionvar grid = ISGetObject('WebGridComissions');var table = grid.GetRootTable();var checkedRows = table.GetCheckedRows();for (var i = 0; i < checkedRows.length; i++){ alert(checkedRows[i].cells[4].cellValue); //Cell value alert(checkedRows[i].cells[4].innerText); // Cell text}/// Server side protected void WebGridComissions_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e) { if (e.Row.Type == ISNet.WebUI.WebGrid.RowType.Record) { ISNet.WebUI.WebGrid.WebGridCellCollection cells = e.Row.Cells; DataRowView dr = (DataRowView)e.Row.DataRow; int classId = (int)dr["Id"]; cells.GetNamedItem("ClassName").Value = classId; } }
GetCheckedRows() method returns object of HTML RowElement collection. In order to access the cell value or text of the checked rows, I suggest you to convert the HTML RowElement collection (returned by GetCheckedRows() method) into WebGridRow object first. After get the WebGridRow object, then you can access its cell value and/or text or any properties related to the respective cell.
Below is the snippet code that shows how to do the conversion plus how to obtain the cell properties.
<script type="text/javascript"> <!-- function GetCurrentCheckedRows() { // retrieves WebGrid's object var grid = ISGetObject("WebGrid1"); // access WebGrid's RootTable var rootTable = grid.RootTable; // get the current CheckedRows (return HTMLElement) var checkedRowsElement = grid.RootTable.GetCheckedRows(); for (var i = 0 ; i < checkedRowsElement.length ; i++) { // convert HTMLElement to WebGridRow object var row = rootTable.ToRowObject(checkedRowsElement[i]); alert(row.GetCells().GetNamedItem("CompanyName").Text); alert(row.GetCells().GetNamedItem("CompanyName").Value); } return true; } --> </script>
Hope this helps.
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