Welcome Guest Search | Active Topics | Sign In | Register

Select All Command on Grid Options
Atex
Posted: Friday, October 4, 2013 4:44:18 AM
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.
eo_support
Posted: Friday, October 4, 2013 11:19:02 AM
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.aspx

Hope this helps.

Thanks!
Atex
Posted: Friday, October 25, 2013 1:23:06 PM
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.
eo_support
Posted: Friday, October 25, 2013 1:28:49 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.