jqGrid 列选择器对话框可调整大小,但调整大小时内部内容不会在调整大小时拉伸 [英] jqGrid Column Chooser dialog is resizable but when resized the inner contents are not stretched on resize

查看:19
本文介绍了jqGrid 列选择器对话框可调整大小,但调整大小时内部内容不会在调整大小时拉伸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jqGrid 和 ui.multiselect.js 进行列选择和重新排序.出现的对话框是可调整大小的,但在调整大小时,对话框的内容不会调整大小.您是否必须参与任何活动?

I am using jqGrid with ui.multiselect.js for column choosing and reordering. The dialog which comes up is resizable but when resized, the contents of the dialog are not resized. Do you have to hook into any event do the stuff?

推荐答案

你是对的.目前是列选择器的问题.

You are right. Currently it's a problem in the column chooser.

最好在 columnChooser 方法的代码中做一些修复.在创建对话框后,您可以通过在列选择器"对话框中进行一些更改来改善调整大小的情况.比如下面的代码

It's better to make some fixes in the code of the columnChooser method. Before all you can improve the situation with resizing by making some changes in the Column Chooser dialog after the dialog is created. For example with the following code

$(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%');

水平调整大小将获得相当不错的结果(请参阅 演示).以这种方式,您可以解决或至少改善调整大小的结果.

you will have fairly good results with the horizontal resizing (see the demo). In the way you can either solve or at least have improve the results of resizing.

更新:我发布了 这里 建议使 columnChooser 真正可调整大小.您可以在 演示上查看结果.

UPDATED: I posted here suggestions to make columnChooser really resizable. You can see the results on the demo.

这篇关于jqGrid 列选择器对话框可调整大小,但调整大小时内部内容不会在调整大小时拉伸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆