当前位置: 代码迷 >> .NET相关 >> easyui combogrid的有关问题
  详细解决方案

easyui combogrid的有关问题

热度:261   发布时间:2016-04-24 03:02:36.0
easyui combogrid的问题
大家好,我是easyui 菜鸟
我想请问下easyui combogrid如何设置选中的值啊
主要的问题是
TypeError: $(...).combogrid is not a function
这样让只能用css的模式来创建combogrid 
但是我要设置它选中的值,用css模式就不行了
        $(function () {
            $('#sh_tonnage').combogrid('setValue','002');
        })
我都是按照官方来的,不知道怎么回事
我用的asp.net +easyui。
我想知道的是有没有办法其他办法设置他css模式下data-options下的json的属性啊
请指教
------解决方案--------------------
加个扩展:
$.extend($.fn.datagrid.defaults.editors, {
                combogrid: {
                    init: function (container, options) {
                        var input = $('<input type="text" class="datagrid-editable-input">').appendTo(container);
                        input.combogrid(options);
                        return input;
                    },
                    destroy: function (target) {
                        $(target).combogrid('destroy');
                    },
                    getValue: function (target) {
                        return $(target).combogrid('getValue');
                    },
                    setValue: function (target, value) {
                        $(target).combogrid('setValue', value);
                    },
                    resize: function (target, width) {
                        $(target).combogrid('resize', width);
                    }
                }
            });
  相关解决方案