|
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
|
|
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.aspxBecause 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!
|
|
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...
|
|
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!
|
|
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!
|
|