Forum

July 12th, 2025
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
How to focus on a specific cell?
13/01/2012
03:58
Avatar
mice-pace
Member
Members
Forum Posts: 5
Member Since:
05/01/2012
sp_UserOfflineSmall Offline

I've been rummaging arround on the net for a while trying to find an answer for this, and i've found a few hints in the right direction but i'm having trouble getting it to work

What i'd like to do, is when you tab away from the last editable cell it moves you to the next row and then activates one specific cell ('Description', 7th column)

fn: function(e) {
                            var key = e.charCode || e.keyCode; // to support all browsers
                            if(key == 9) { // tab
                                if (lastSel) {
                                    var ind = grid.jqGrid('getInd', lastSel, false);
                                    var dataIDs = grid.jqGrid('getDataIDs');
                                    if (ind < dataIDs.length) {
                                        var nextRowID = dataIDs[ind];
                                        grid.jqGrid('setSelection', nextRowID, true); // trigger onSelectRow
                                        //You are at the end of the row, but not the last row. Go to next row
                                        //$('textarea[name="description"]', ind).focus();
                                        grid.editCell( nextRowID, 7, false);
                                    } else {
                                        addRow();
                                        var nextRowID = dataIDs[ind];
                                        grid.editCell( nextRowID, 7, false);
                                        //You are at the end of the last row. Create new row... Selects it automatically?
                                    }
                                }
                                return false;

Right now it's going to the next line, but not doing much with the 'editCell'... am i calling it the wrong way perhaps? i changed it once already when i was getting errors

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

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