Forum


00:57

13/07/2011

When the grid loads, I would like a selected row to be highlighted as if it were clicked. I tried several things using setSelection but although it positions, it doesnt highlight. Also same thing when first loading the grid. The first row doesnt get selected.
Is there some trick to this?
I am using jquery.jqGrid-4.1.1
Thanks
04:19

13/07/2011

Thanks for that reply dude... It made me think and realize what I was doing wrong. I had my gridComplete: event like this:
I had to changed it to this. and everything works now.
gridComplete: function () {
gridXComplete();
},
/// Here is the start of the function....
function gridXComplete(){
selRow=$('#list').getDataIDs()[0];
$('#list').setSelection(selRow, true);
/// other code here......
}
I guess you cannot call a function directly as parameter and need to enclose it inside function(). Not sure why but it works.
04:19

13/07/2011

Thanks for that reply dude... It made me think and realize what I was doing wrong. I had my gridComplete: event like this:
I had to changed it to this. and everything works now.
gridComplete: function () {
gridXComplete();
},
/// Here is the start of the function....
function gridXComplete(){
selRow=$('#list').getDataIDs()[0];
$('#list').setSelection(selRow, true);
/// other code here......
}
I guess you cannot call a function directly as parameter and need to enclose it inside function(). Not sure why but it works.
Most Users Ever Online: 715
Currently Online:
66 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