我让columnchooser一切运作良好。 当我添加'完成'回调函数(甚至是空函数)时,一切正常但列的顺序 - 似乎我放的任何顺序都没有效果。
以下是代码:
$('#jqGrid').jqGrid('navButtonAdd', '#jqGridPager', {
caption: "",
buttonicon: "ui-icon-calculator",
title: "Choose columns",
onClickButton: function () {
$('#jqGrid').jqGrid('columnChooser',{
width: 550,
msel_opts: {dividerLocation: 0.5},
modal: true,
//To Do - calling the done event cancelling the reorder of the column - need to find out why.
done: function() {
$('#jqGrid').setGridParam({ postData:sessionListData(pageOffset,sortingAddition,pageLength,$(this)) }).trigger("reloadGrid");
$(window).resize(function() {
sessionList(pageOffset,$(this),sortingAddition,pageLength);
$("#jqGrid").jqGrid('setGridWidth', $('.ui-layout-center').width() + 5, true);
}).trigger('resize');
}
});
$("#colchooser_" + $.jgrid.jqID(this.id) + ' div.available>div.actions')
.prepend('<label style="float:left;position:relative;margin-left:0.6em;top:0.6em">Search:</label>');
var d=$("div.ui-dialog[aria-labelledby='ui-dialog-title-colchooser_list']");
d.height(530);
$("div#colchooser_list").height(400);
$("div.selected, div.available").height(350);
$("div.selected, div.available","div#colchooser_list").height(350);
}
});