Welcome Guest Search | Active Topics | Sign In | Register

Onclick Event Grid Cell Options
CodeMaster
Posted: Friday, November 12, 2010 11:25:41 AM
Rank: Advanced Member
Groups: Member

Joined: 10/14/2010
Posts: 19
I have a Grid and if a user clicks on a particular cell (I have it defined as static) I need to open a new window.

How do I attached an onclick event to a cell?
CodeMaster
Posted: Friday, November 12, 2010 11:56:28 AM
Rank: Advanced Member
Groups: Member

Joined: 10/14/2010
Posts: 19
I want to clarify one point.

The onclick event that will open an window needs to pass some values. Those values are in hidden columns in the grid. I would prefer to add the onclick event on the server side before the page is rendered. I know I can gain access to the cell but how to attach the onlick so that I can use the hidden values in the grid?

If it can be done on the client if the server side does not support it that would work too.
eo_support
Posted: Friday, November 12, 2010 1:59:27 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
CodeMaster
Posted: Tuesday, November 16, 2010 5:35:44 PM
Rank: Advanced Member
Groups: Member

Joined: 10/14/2010
Posts: 19


When I capture the click event I need to get some of the hidden values from the grid. The doc above talks about one cell. How do I go about getting hidden values?
eo_support
Posted: Wednesday, November 17, 2010 8:49:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can get any cell with our client side API. For example, the following code get the value of the first cell:

Code: JavaScript
//Get the Grid
var grid = eo_GetObject("Grid1");

//Get the first item
var firstItem = grid.getItem(0);

//Get the first cell in the item
var firstCell = firstItem.getCell(0);

//Get the cell value
var value = firstCell.getValue();


You can take a look of this page if you have not used our client side API before:

http://doc.essentialobjects.com/library/1/clientapi_howto.aspx

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.