Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
When grid loads, I want the row highlighted.
27/07/2011
00:57
Avatar
wyattbiker
Member
Members
Forum Posts: 8
Member Since:
13/07/2011
sp_UserOfflineSmall Offline

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

27/07/2011
06:04
Avatar
Rakeka
Brazil
Member
Members
Forum Posts: 3
Member Since:
27/07/2011
sp_UserOfflineSmall Offline

Have you tried the loadComplete event?

Something like this:

$('#gridID').jqGrid
({

/* other options ... */

loadComplete:
function()
{
    $('#gridID').setSelection($('#gridID').getDataIDs()[0], true);
}

});

It will select the first row even when you change pages.

28/07/2011
04:19
Avatar
wyattbiker
Member
Members
Forum Posts: 8
Member Since:
13/07/2011
sp_UserOfflineSmall Offline

Thanks for that reply dude... It made me think and realize what I was doing wrong. I had my  gridComplete: event like this:

 

gridComplete: gridXComplete(),

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.

28/07/2011
04:19
Avatar
wyattbiker
Member
Members
Forum Posts: 8
Member Since:
13/07/2011
sp_UserOfflineSmall Offline

Thanks for that reply dude... It made me think and realize what I was doing wrong. I had my  gridComplete: event like this:

 

gridComplete: gridXComplete(),

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information