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
Focus on grid row
17/06/2009
15:43
Avatar
casperd
Member
Members
Forum Posts: 76
Member Since:
11/05/2009
sp_UserOfflineSmall Offline

Hi,

How do I set focus to a specifc row in a grid?

Thanks!

17/06/2009
20:27
Avatar
Drew
Austin, TX
Member
Members
Forum Posts: 7
Member Since:
16/06/2009
sp_UserOfflineSmall Offline

I'm not sure what you mean by focusing- I'm going to assume you mean highlighting/outlining the row.  If that's the case:

I think you could try using the onSelectRow event:

$('#myGrid').jqGrid({
...
onSelectRow: function(id) {
  $('#' + id).addClass("focusCssClass");
}
});

17/06/2009
21:31
Avatar
Romyn
Member
Members
Forum Posts: 45
Member Since:
13/06/2009
sp_UserOfflineSmall Offline

...or

...if you meant how to select a row with code as opposed to actually clicking on it then ...from the demos - http://trirand.com/jqgrid/jqgrid.html - Advanced  - Multi-Select ....

Select (unselect) Row 13

jQuery("#list9").setSelection("13");

Romyn

18/06/2009
01:43
Avatar
casperd
Member
Members
Forum Posts: 76
Member Since:
11/05/2009
sp_UserOfflineSmall Offline

Hi Romyn,

It's definitely the setSelection method I need. But, I need it to execute after all my grids have loaded, and not on a onClick event (as in the example).

Hope you can help me.

Thanks!

18/06/2009
09:50
Avatar
Romyn
Member
Members
Forum Posts: 45
Member Since:
13/06/2009
sp_UserOfflineSmall Offline

Hi,

…then just do it when you need to. I've just tried it, as I needed to the same, and it worked fine. I have a number of grids that initialise and load when the page is loaded and in addition to that I select a default row within one of those grids (grid_r)…. so I do (my function names)

initialiseGrids();

loadGridData();

$(”#grid_r”).setSelection(curr_ID);

where curr_ID is my default row number.

That then selects the row for me and executes the OnRowSelect function which does whatever it does etc.

As long as the grid is there you can do it whenever you want within your code.

Hope that helps

Regards

Romyn

19/06/2009
05:58
Avatar
casperd
Member
Members
Forum Posts: 76
Member Since:
11/05/2009
sp_UserOfflineSmall Offline

Awesome! it's working!

Thanks Romyn!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
30 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