I'm using a UltraWebGrid ( v6.1, Version=6.1.20061.1076 ) and have declared a checkbox for one of the columns. I would like to have the checkboxes mutually exclusive, so that only one checkbox can be checked at any one time. I didn't see properties or options to set that would readily do this.
I was hoping not have to loop through each row when a user checks a box to see if any other checkboxes have been checked, and then pop up some message indicating that's not allowed. And or just uncheck any checkboxes that may have been already checked. In other words I would like to take the path of least resistance. Anyone have any experience with this, or implemented this kind of functionality. Thanks..
Ya...just found some old code with that
var grid = igtbl_getGridById(gridName);
Got it.. Thanks for your time, appreciate it!
Jeff
You would want to get to the WebGrid Client Object and then use the WebGrid Client Side Object Model to navigate to the rows.
to get the grid its
the rows would be
for (var i = 0 ; i < grid.Rows.length ; i++)
{
var row = grid.Rows.getRow(i);
if (row.getCell(0).getValue() == true)
// do something
}
The JS you have will try to get the HTML DOM object for the Grid, not the JavaScript object for it.
Ya...that's what I figured. Well...could you tell me this then. How would I get a handle to the webgrid without using one of the grids Client side JavaScript events?
In other words, when the user pushes the "Next" button, I do some Javascript form validation. One of the checks is to see if any of the checkboxes has been checked in the grid. So how do I get a "handle" to the grid? I know how toget a reference / handle to the grid object itself with
var oGrid = document.getElementById("uwgSecurityGrps");
But that's not getting me what I want. In other words, access to the functions and methods of the grid. Does that make sense? You see what I'm saying?
Thanks.
Hello Jeff,
There is nothing in the default WebGrid that is going to provide this functionality, besides looping.