Welcome Guest Search | Active Topics | Sign In | Register

Grid Context Menu Causes Page_Load unexpectedly Options
Sean Clark
Posted: Monday, July 18, 2011 6:51:43 AM
Rank: Advanced Member
Groups: Member

Joined: 12/24/2008
Posts: 43
Hi

I have an EO Grid on my page. The first column is rendered with the ClientSideGetText property.

It references the following javascript:

function EOGridContextMenuItemText(column, item, cellValue) {
if (cellValue != null) {
var celldatavalues = cellValue.split("||");
var ItemID = celldatavalues[0];
var ItemKind = celldatavalues[1];
var FolderKind = celldatavalues[2];
var ItemMarkedAsRead = celldatavalues[3];
var Reportname = celldatavalues[4];
var style;
if (FolderKind.toUpperCase() == "INBOX") {
if (ItemMarkedAsRead.toUpperCase() == "FALSE") {
style = "color: red;";
}
}
return '<a href="javascript:void(0);" onclick="javascript:debugger;eo_Callback(\'Callback1\', ' + ItemID + ');ShowContextMenu(event,\'' + item.getIndex() + '\');return false;" style="' + style + '">' + Reportname + '</a>';
}
else
return '';
}

I was having an issue where clicking on one of the context menu items was raising two server side onclick events, and whilst troubleshooting this, I noticed that the click on the hyperlink in the grid column would raise a page_load event on the server side.

This page load event fires before the server side methods for Callback1 are fired.

Would you expect a page_load to be fired by a click on a grid row?
Sean Clark
Posted: Monday, July 18, 2011 8:16:48 AM
Rank: Advanced Member
Groups: Member

Joined: 12/24/2008
Posts: 43
I have just taken this code and isolated it on a single page.

The page posts back when the hyperlink in the grid column is clicked. Perhaps I am missing a return somewhere in my javascript?

Any ideas?
Sean Clark
Posted: Monday, July 18, 2011 8:49:54 AM
Rank: Advanced Member
Groups: Member

Joined: 12/24/2008
Posts: 43
It looks like the eo_Callback call is triggering the postback. Thing is, the postback page_load event fires before the Callback1_Execute server side event.

Would you expect that?
eo_support
Posted: Monday, July 18, 2011 11:52:30 AM
Rank: Administration
Groups: Administration

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

Page_Load event is always fired whenever you have a server side event on a control.

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.