Forum


19:38

21/08/2012

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)));
},
21:33

21/08/2012

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:27

21/08/2012

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.
I feel like I'm close on this one...
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66