Forum


17:34

09/10/2009

There are many very useful extension points in the grid however I often find that I'd like the default behavior for an event to still take place, along with a bit of my code. So have it run the code in my function and then do what it normally would have done have I not provided this function.
For example, say I implement beforeSelectRow event:
beforeSelectRow: function(rowid) {
jQuery("#my_div").css({ "white-space" : "normal", "height" : "30px" });
},
Is there a way to then call the default beforeSelectRow() event handler in jqGrid? Something like base.beforeSelectRowI(rowid)?
I know this isn't exactly object oriented programming so, I'm wondering if there's a way to emulate this behavior. use jquery's trigger event functionality?
04:24

Moderators
30/10/2007

Hello,
For what I understand you can:
beforeSelectRow: function(rowid, e)
{
myfunction();
}
Outside the grid
function myfunction ()
{
// do something
}
And then you can call it where you want
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
12:06

09/10/2009

Thanks for the reply Tony. Sorry, I don't think I explained my problem right. So jqgrid has default event behavior for when the user selects a row for example. If I implement an event, like beforeSelectRow, then the default behavior does not happen. Only what's in my beforeSelectRow function will be run. I'm trying to find a way to have it do both. Execute jqgrid's default event behavior as well as my code.
beforeSelectRow: function(rowid) {
// do some custom code
// do jqgrid's default beforeSelectRow code
};
04:00

13/11/2009

Hello,
Is there something special to do for the "return true" to work ?
I had that first problem : http://www.trirand.com/blog/?p.....ut-fields/
Thank's to Mark, this is solved, except that in my case, the return true does not seem to execute default behaviour.
beforeSelectRow: function(rowId, e) {
myBeforeSelectRow(rowId,e);
}
//outside the grid : this should act as default handler
function myBeforeSelectRow(rowid, e) {
return true;
}
This code does not work for me, either on ie 6, nor firefox 3.x & jqgrid 3.6
Thank's for your help
Sloub
Most Users Ever Online: 715
Currently Online:
72 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66