easyui datagrid 사용자 정의 편집기

4056 단어 datagrid
 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 }

                            ]]

                        }

                }

            }

좋은 웹페이지 즐겨찾기