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
Cannot select row after unselecting it
03/01/2012
13:10
Avatar
ChrisXa
Member
Members
Forum Posts: 5
Member Since:
02/01/2012
sp_UserOfflineSmall Offline

Hi everyone,

when selecting a row and unselecting it (not in multiselect mode), the row cannot be selected again. The problem is, that the grid internally still stores the unselected row as selrow and thus prevents me from selecting it again.

The solution is to reset selrow when unselecting a row. I fixed this here: https://github.com/ChrisXa/jqGrid/commit/d62b8fdf9090f23c63926042a180aed420a9db0f

Best regards,

Chris

03/01/2012
13:45
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Thanks for this, but my question is?

How you unselect the row?

Usually you should implement resetSelection which set the selected row to null.

All other cases are a custom resets where you will need to set the selarrrow to null manually too.

Regards

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.

04/01/2012
18:02
Avatar
ChrisXa
Member
Members
Forum Posts: 5
Member Since:
02/01/2012
sp_UserOfflineSmall Offline

Hi,

I am calling resetSelection when unselecting the row. Here is my onSelectRow function:

            onSelectRow: function (rowid, selected) {
                if (selected) {
                    // do stuff, load content to other divs
                } else {
                    grid.resetSelection(rowid);
                    // remove other divs
                }
            }

However, selected is only true the first time I click the row. After unselecting the row, selected is always false until I select another row.

Best regards,

Chris

05/01/2012
13:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

This is not correct using.

Try:

onSelectRow: function (rowid, selected) {
    if (selected) {
           // do stuff, load content to other divs
    } else {

          setTimeout( function() {

              grid.resetSelection(rowid);

          }, 100);
         // remove other divs
    }
}

Regards

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.

05/01/2012
18:57
Avatar
ChrisXa
Member
Members
Forum Posts: 5
Member Since:
02/01/2012
sp_UserOfflineSmall Offline

Thanks for your suggestion. I am currently using my fix as describe above, which works quite fine for me. Is there any reason why I should use the timeout instead of the fix? That doesn't look like clean code.

Regards,

Chris

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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