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_Related Related Topics sp_TopicIcon
setGridParam bug?
21/10/2010
22:35
Avatar
Greg B
Member
Members
Forum Posts: 10
Member Since:
25/01/2010
sp_UserOfflineSmall Offline

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

25/10/2010
18:12
Avatar
Greg B
Member
Members
Forum Posts: 10
Member Since:
25/01/2010
sp_UserOfflineSmall Offline

Still seeing this behavior with jqGrid 3.8.1

25/10/2010
18:37
Avatar
Greg B
Member
Members
Forum Posts: 10
Member Since:
25/01/2010
sp_UserOfflineSmall Offline

Ok, not a bug. Just me Embarassed

By adding a JSON.stringify(status) call to my status variable, this seems to make the setGridParam call happier and it behaves consistently.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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