Welcome Guest Search | Active Topics | Sign In | Register

eo_GetObject returns null for Grid Object Options
Sean Clark
Posted: Tuesday, July 19, 2011 11:02:57 AM
Rank: Advanced Member
Groups: Member

Joined: 12/24/2008
Posts: 43
Hi

I have a Grid inside a callback panel in a user control. The grid is called EOReportsList, the callback panel is called GridCalllbackPanel and the user control is SelectReport.

To my mind, I should be able to execute eo_GetObject ('EOReportsList') and get an reference to the grid, but this returns null, meaning I cannot execute:

//var grid = eo_GetObject('<%=EOReportsList.ClientID %>');
var grid = eo_GetObject('EOReportsList');
grid.selectItem(recId); //recId is passed in to the function.
eo_ShowContextMenu(e, MenuID);

The purpose of this is to display a context menu upon clicking on a grid cell.

I have tried using ClientID from the server side in the javascript above commented out, but to no avail.

When I look at the rendered html, the EO Divs are named as follows:

<!-- Begin EO.Web Grid EOReportsList. -->
.......
<input type="hidden" id="SelectReport_EOReportsList_data" name="SelectReport_EOReportsList_data"
.......

Why would eo_GetObject not find the control?

If I take the callback panel out of the equation then the eo_GetObject fails but then I get the serverside GridContextMenu_ItemClick firing twice when I click on one of the context menu items that cause a post back (not all of the menu items require a post back).

Cheers
Sean
eo_support
Posted: Tuesday, July 19, 2011 11:33:38 AM
Rank: Administration
Groups: Administration

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

This usually means you are calling the function too early before the Grid has been initialized. You can either try to use setTimeout to delay the call, or handle the Grid's ClientSideOnLoad event so that you will know when the Grid has been loaded.

If the problem continues, please try to create a test page that demonstrates the problem. Make sure the page runs and only contain code needed to reproduce the problem. We will be happy to take a look as soon as we have that.

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.