无论如何,jqGrid中是否包含一个MultiSelect Combobox? [英] Is there anyway to include a MultiSelect Combobox in a jqGrid?

查看:109
本文介绍了无论如何,jqGrid中是否包含一个MultiSelect Combobox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jqGrid,我希望一列成为多选组合框.我有一个插件,

I have a jqGrid and I want one column to be a multiselect combobox. I got a plugin from,

http://www.abeautifulsite.net/blog/2008/04 /jquery-multiselect/

如何将它们集成在一起,以及如何获取选定的值?

How to integrate those, and how to get the selected values?

推荐答案

您可以使用

You can use jQuery UI MultiSelect Widget for example to implement multiselect with checkboxes.

演示显示了如何实现此目的.您将得到如下结果

The demo shows how you can implement this. You will have the results like the following

您可以使用不同的选项来自定义multiselect插件.在演示中,我使用了以下代码

You can customize multiselect plugin using different options. In the demo I used the following code

edittype: 'select', editoptions: {
    value: 'FE:FedEx;TN:TNT;IN:Intim',
    dataInit: function (elem) {
        setTimeout(function () {
            $(elem).multiselect({
                minWidth: 100, //'auto',
                height: "auto",
                selectedList: 2,
                checkAllText: "all",
                uncheckAllText: "no",
                noneSelectedText: "Any",
                open: function () {
                    var $menu = $(".ui-multiselect-menu:visible");
                    $menu.width("auto");
                    return;
                }
            });
        }, 50);
    },
    multiple: true,
    defaultValue: 'IN'
}

我应该提到,您可以编辑多个可选列表,而无需使用任何插件.唯一的缺点是用户界面不太好. 下一个演示显示了没有多选插件的所有工作原理.

I should mention that you can edit multiple selectable list without using any plugins. The only disadvantage is that the user interface will be not so nice. The next demo shows how all works without multiselect plugin.

已更新:如果您需要在加载后立即将所有行设置为编辑模式,则可以像在下一个演示中一样进行操作.

UPDATED: If you need to set all rows in editing mode directly after the loading you can do this like in the next demo.

这篇关于无论如何,jqGrid中是否包含一个MultiSelect Combobox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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