|
Rank: Newbie Groups: Member
Joined: 8/29/2013 Posts: 4
|
Please how can i use a command button to do select all on the grid instead of having to select each grid one after the other.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, You will need to use our client side API to do that. It will be something like this:
Code: JavaScript
//Get the client side Grid object
var grid = eo_GetObject("Grid1");
//Loop through all items
for (var i = 0; i < grid.getItemCount(); i++)
{
//Get the GridItem object
var gridItem = grid.getItem(i);
//Get the first cell of the item, assuming the first column
//is a CheckBoxColumn
var gridCell = gridItem.getCell(0);
//Check the cell
gridCell.setValue(1);
}
If you have not used our client side API before, you will want to take a look of this topic first: http://www.essentialobjects.com/doc/1/clientapi_howto.aspxHope this helps. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 8/29/2013 Posts: 4
|
Hi, I have checked the client API and tried the javascript above, it hasn't worked. I am not a guru on javascript but am learning on my own.
Aside this, how can I implement a button on a grid. I have a buttoncolumn on my grid, when I click it, I want it to return values from the row into some text box.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
You will need to be familiar with JavaScript in order to do those things. If you use a ButtonColumn, you would set column's CommandName property. You would then handle the Grid's ClientSideOnItemCommand property with JavaScript. Inside your handler you can do anything you want with the Grid's client side JavaScript interface. So there is no escape from JavaScript on these things.
Thanks!
|
|