我使用带有ui.multiselect.js的jqGrid进行列选择和重新排序。弹出的对话框是可调整大小的,但当调整大小时,对话框的内容不会调整大小。你一定要挂在任何事件中做这些事情吗?
发布于 2012-01-25 05:55:57
你是正确的。目前这是列选择器中的一个问题。
最好在columnChooser方法的代码中进行一些修复。最重要的是,您可以通过在创建对话框后在列选择器对话框中进行一些更改来改善调整大小的情况。例如,使用以下代码
$(this).jqGrid('columnChooser',
{width: 550, msel_opts: {dividerLocation: 0.5}});
var columnChooser = $("#colchooser_" + $.jgrid.jqID(this.id));
columnChooser.css('min-width', columnChooser.width() + 'px');
var dialog = columnChooser.closest('div.ui-dialog');
columnChooser.closest('div.ui-dialog').css('min-width', dialog.width() + 'px');
var div = columnChooser.children('div:has(div.ui-multiselect)');
div.css('width', '100%');
var uiMultiselect = div.children('div.ui-multiselect');
uiMultiselect.css('width', '100%');
uiMultiselect.children('div.available').css({width: '49.9%'});
uiMultiselect.children('div.selected').css('width', '49.9%');通过水平调整大小,你会得到相当好的结果(参见the demo)。在这种方式下,您可以解决或至少可以改善调整大小的结果。
更新了:我发布了here建议,让columnChooser变得真正可调整大小。你可以在the demo上看到结果。
https://stackoverflow.com/questions/8993308
复制相似问题