Forum
22:35
25/01/2010
I have 3 checkboxes I use to toggle sql paramaters I search on ("#OnTrip","#JUNK", and "#SOLD"). I seem to be running into what I think is a possible bug when calling setGridParam successively (jqGrid 3.8, jQuery 1.4.3, jQuery-ui 1.8.5)
The code is as follows:
function status_checkboxes() {
status=[];$.each([$("#OnTrip"),$("#JUNK"),$("#SOLD")],function(i,e) {
if ($(e).attr("checked")==true) {
status.push($(e).attr("id"));
}
});
console.log(status);
if (status.length>0) {$(POL.currentGrid).jqGrid('setGridParam',{ postData:{ status: status }});
}
else {$(POL.currentGrid).jqGrid('setGridParam',{ postData:{ status:"off"}});
}
$(POL.currentGrid).trigger('reloadGrid');
return true
}$(document).ready(function(){
…
$("#OnTrip").bind("click",status_checkboxes);
$("#JUNK").bind("click",status_checkboxes);
$("#SOLD").bind("click",status_checkboxes);});
When I check JUNK, then SOLD, then un-check SOLD, it correctly sets the "status" variable to only ["JUNK"] but ["JUNK","SOLD"] is passed on setGridParam (confirmed with Firebug). Using Firefox 3.6.11 on a Mac.
All help appriciated. Thanks!
Greg
Most Users Ever Online: 715
Currently Online:
25 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66