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
Drag a row to resort, after reloading grid cell widths changed to be all the same
09/02/2012
20:16
Avatar
Ricardo Montalban
Member
Members
Forum Posts: 9
Member Since:
28/05/2010
sp_UserOfflineSmall Offline

I have implemented the drag to resort functionality on a grid:

$my_grid.jqGrid(
            'sortableRows', {
                update: function(e, ui) {
                    sort_grid(e, ui);
                }
            }
        );

That sort_grid method changes some numbers used in the display of the grid, saves it back to the database and then reloads the grid like so:

        $.ajax({
            url:theurl,
            type:"POST",
            data:"moved_id=" + moved_id + "&next_id=" + next_id + "&next_priority=" + next_priority,
            success: function(data) {

                $('.grid').setGridParam({loadonce:false, datatype:'json'}); // force grid refresh from server
                $('#' + current_grid).trigger("reloadGrid");
                $('.grid').setGridParam({loadonce:true}); // reset to use local values

            }
        })

The problem is that right after reloadGrid is called, the grid refreshes and all of the widths on the grid cells have been changed to some default. Like they are all the same percentage of the overall grid width. When the grid was created I set the column widths in colModel like:

colModel:[
                {name:'priority', index:'priority', sortable:true, sorttype:'int', width:40, classes:'gridbox', align:'center'},

...etc.

]

Given that I tried changing that last setGridParam to:

$('.grid').setGridParam({

loadonce:true,

colModel:[
                {name:'priority', index:'priority', sortable:true, sorttype:'int', width:40, classes:'gridbox', align:'center'},

...etc.

]

});

But this did not help. The widths still get reset. Any suggestions on how to maintain my cell widths in this situation?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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