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
unselect row once hover changes to different row?
22/08/2012
19:38
Avatar
RonConrad
Indiana
Member
Members
Forum Posts: 9
Member Since:
21/08/2012
sp_UserOfflineSmall Offline

Is there a way to unselect a row (onSelectRow) once you hover over a different row?

My grid passes control to another tab/window during the onSelectRow function.  Once control is back to the grid, and the user hovers over a different row, how do I "unhighlight/deselect" the previously selected row?

Here is my onSelectRow function:

            onSelectRow: function (id) {            // If user selects a row, call the page that displays building info.
                var listid = jQuery('#list').getCell(id, "BLDGCODE");
                var theEntireURL = (window.location.href);
                var endOfString = theEntireURL.indexOf("jqGridFilterExample");
                var theURL = theEntireURL.substr(0,endOfString)+'DisplayBuildingFG.cfm?BuildingCode='+listid;
                $(window.open(rtrim(theURL)));
             },

22/08/2012
21:18
Avatar
krisreddy
Member
Members
Forum Posts: 37
Member Since:
24/02/2009
sp_UserOfflineSmall Offline

you can try jQuery('#list').jqGrid('resetSelection');

after you open the url

22/08/2012
21:33
Avatar
RonConrad
Indiana
Member
Members
Forum Posts: 9
Member Since:
21/08/2012
sp_UserOfflineSmall Offline

Yes resetSelection is the method I need, but what method should I call it from?  Is there an event/method for hovering over a row?

I tried putting it in "afterSelectRow", but that method never fires because control is passed to the other tab at that point (with my "$(window.open(rtrim(theURL))); statement.  I've also tried putting it after that line in the onSelectRow function, but it never hits it.

putting $(resetSelection()); resets the selection, but never lets me actually call the onSelectRow function.

putting it in a mousemove type method would be ideal...

22/08/2012
21:44
Avatar
RonConrad
Indiana
Member
Members
Forum Posts: 9
Member Since:
21/08/2012
sp_UserOfflineSmall Offline

I think ideally I need to run $(resetSelection()); once this window has focus again.  How would I accomplish this?  Thanks!

22/08/2012
22:27
Avatar
RonConrad
Indiana
Member
Members
Forum Posts: 9
Member Since:
21/08/2012
sp_UserOfflineSmall Offline

Ok, here's what I have, but I still cannot get the grid to reset...

    var grid=$("#list");
    $(function() {
        $(window).focus(function() {
            // your code here $.jqgrid.....;
            console.log("before");
            grid.jqGrid('resetSelection');
            console.log("after");
        });
    });

in FireBug I always get "before", and "after" messages, but the grid never resets.  If I change the name of the method I receive an error so I know the grid.jqGrid('resetSelection'); is being called but no result, and the selected row remains selected. Frown

I feel like I'm close on this one...

24/08/2012
20:18
Avatar
krisreddy
Member
Members
Forum Posts: 37
Member Since:
24/02/2009
sp_UserOfflineSmall Offline

Instead of window.open – could you make an ajax call and open the window in diaglog and call the resetSelection in the loadComplete event. 

$("#someDiv").load(URL,function(){

grid.jqGrid('resetSelection');

});

27/08/2012
17:30
Avatar
RonConrad
Indiana
Member
Members
Forum Posts: 9
Member Since:
21/08/2012
sp_UserOfflineSmall Offline

Thanks for the advice...I could not get that to work either.  Has anyone created code for a "deselect" button for the jqGrid?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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