dmittner

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • in reply to: (With solution) Pager option breaks grid v 4.0 #95401
    dmittner
    Participant

    I’d just like to make the suggestion that jqGrid handles this situation more gracefully, throwing a console error or something when the language file is missing. I reworked my dynamic script loading and was running into this because I neglected to include the language file and I’d have been chasing my tail for a long time if not for this forum topic.

    in reply to: sortGrid breaking pagination? #102045
    dmittner
    Participant

    Here's a jsFiddle with an example of the problem.

    http://jsfiddle.net/Jq2HR/

    In making that I learned that the issue only exists when sortGrid is executed within the loadComplete event handler. If it's executed separately then subequent navigation works fine. So whatever is happening that's messing up the behavior must be running internally after the loadComplete event fires, but since that's the last event in the data loading process, there's no option for me to execute sortGrid any later.

    The only remaining option I can think of would be to set a timeout in loadComplete to execute sortGrid after jqGrid is finished doing whatever it does after that event. Seeing as though I'm just trying to fix a subtle visual this is a possibility, but might fall out of sync if a user paginates quickly, so clearly not ideal.

    IMO the best solution would be for jqGrid to support server-side sorting defining. So if the server provides sort/order variables (or whatever is defined in prmNames) in the response, those will automatically overwrite whatever jqGrid already thinks sorting is. The server being the authorative source over how the data is actually sorted, it makes sense that it could tell jqGrid that for proper presenation. I actually expected this behavior to exist already and have returned sorting information this whole time…

    in reply to: sortGrid breaking pagination? #102032
    dmittner
    Participant

    The idea to call sortGrid in loadComplete event is very dangerous. You will go to infity loop.

    No it won't. The second parameter is whether you want it to initiate a reload. I specifically mentioned above that I use this to avoid an infinite loop.

    I think the best idea for this purpose is to use setGridParam to change the sortname parameter and sortorder one.

    Been there, tried that. setGridParam doesn't initiate any visual change to the column headers, which is what I'm trying to solve.

Viewing 3 replies - 1 through 3 (of 3 total)

Stay connected with us in your favorite flavor!