首页 > 代码库 > easyui datagrid 自定义editor

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‘, width: 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‘, width: 100 },                                { field: ‘name‘, title: ‘名称‘, width: 200 },                                { field: ‘description‘, title: ‘描述‘, width: 100 }                            ]]                        }                }            }

 

easyui datagrid 自定义editor