Forum
20:16
28/05/2010
I have implemented the drag to resort functionality on a grid:
'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:
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?
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66