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

查看:238
本文介绍了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天全站免登陆