easyui datagrid 自定义editor

 1   $.extend($.fn.datagrid.defaults.editors, {
 2         mycombogrid: {
 3             init: function (container, options) {
 4                 var input = $('<input type="text" class="datagrid-editable-input">').appendTo(container);
 5                 input.combogrid(options);
 6                 return input;
 7             },
 8             getValue: function (target) {
 9                 return $(target).combogrid('getValue');
10             },
11             setValue: function (target, value) {
12                 $(target).combogrid('setValue', value);
13             },
14             resize: function (target, width) {
15                 $(target).combogrid('resize', width);
16             }
17         }
18     });
{
                field: 'sku', title: 'SKU',  80, editor: {
                    type: 'mycombogrid', options:
                        {
                            required: true, panelWidth: 410,
                            mode: 'remote',
                            valueField: 'sku',
                            idField: 'sku',
                            textField: 'sku',
                            url: '/Product/listSearch',
                            fit: true,
                            required: true,
                            columns: [[
                                { field: 'sku', title: 'sku',  100 },
                                { field: 'name', title: '名称',  200 },
                                { field: 'description', title: '描述',  100 }
                            ]]
                        }
                }
            }
原文地址:https://www.cnblogs.com/tgdjw/p/3939388.html