Welcome Guest Search | Active Topics | Sign In | Register

Grid as a CallbackPanel Trigger Options
Hub
Posted: Thursday, December 23, 2010 9:53:33 AM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
Hello,

This is probably so simple I am ashamed to ask.

I have a grid inside a callbackpanel and want to use the grid as a trigger for the callback (trigger the callback when an item is selected). I have setup the grid as a trigger in the callbackpanel, but nothing is triggered...

So for now I use the onitemselected to call a js function which in turn explicitely executes the callbackpanel. Quite ugly.... and not very portable.

Can you tell me what I am missing to make the grid raise the postback event that will be triggering the callback?

Thanks
eo_support
Posted: Thursday, December 23, 2010 10:32:16 AM
Rank: Administration
Groups: Administration

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

You don't have to think about CallbackPanel while thinking about raising post back on the Grid. As long as the Grid raises post back, the CallbackPanel will work.

There are several ways to raises post back with Grid. If you just want to raises a post back when an item is selected, you can call this method inside your ClientSideOnItemSelected handler:

http://doc.essentialobjects.com/library/1/jsdoc.public.grid.raiseitemcommandevent.aspx

Because you are raising a post back, make sure you call the function with a time delay so that the Grid can finish updating its internal structure first:

Code: JavaScript
setTimeout(function()
{
    grid.raiseItemCommandEvent(....);
}, 10);


Thanks!
Hub
Posted: Thursday, December 23, 2010 3:04:45 PM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
Hi,

Thanks for your answer.

So I still have to execute a client side function for the grid to"trigger" the callbackpanel. Isn't this quite similar to the way I had it working before (call a JS function that executes the callbackpanel).

I thought there might be a way to directly trigger the callback from a grid event the same way a button with autopostback=true would if it was included in the callback trigger collection (I would like to avoid writing any script code in the aspx page so that I can reuse my "fully functional" callbackpanel).

I feel I am missing something...
eo_support
Posted: Thursday, December 23, 2010 4:05:52 PM
Rank: Administration
Groups: Administration

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

You didn't miss anything. ;) The Grid does not have an equivalent of AutoPostBack for ClientSideOnItemSelected. We could add it but because our Grid is very powerful on the client side so most people would just use the client side functionalties. Adding a post back for every client side functionality would result in a bloated product with lot of "features" that would only be used by a small percentage of end users.

Thanks!
Hub
Posted: Thursday, December 23, 2010 7:14:47 PM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
Hello,

I see. I thought a control level postback (as opposed to one for each client side event) could have been useful, leaving it to the server side logic to then find out in which state the grid was.
In any event (so to speak), I find your product very useful and your support stellar.

Thanks and merry christmas!


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.