26.easyui 控件自定義屬性


{
field: 'TITLE_CODE',
title: '提問題目',
width: '50%',
halign: 'center',
align: 'center',
sortable: false,
hidden: false,
formatter: function (value, row, index) {
if (row["TITLE_NAME"] == null || row["TITLE_NAME"] == undefined ) {
return row["TITLE_CODE"];
} else {

return row["TITLE_NAME"];
}
},
editor: { type: 'editorCombobox', options: { valueField: 'TITLE_CODE', textField: 'TITLE_NAME', data: questionTitleList, editable: true} }
}

 

$.extend($.fn.datagrid.defaults.editors, {
editorCombobox: {
init: function (container, options) {
var box = $('<input />').appendTo(container);
box.combobox(options);
return box;
},
getValue: function (target) {
return $(target).combobox('getText');
},
setValue: function (target, value) {
$(target).combobox('setText', value);
},
resize: function (target, width) {
var box = $(target);
box.combobox('resize', width);
},
destroy: function (target) {
$(target).combobox('destroy');
}
}
});

 

 

$.extend($.fn.datagrid.defaults.editors, {   

    text: {   

        init: function(container, options){   

var input = $('<input type="text" class="datagrid-editable-input">').appendTo(container);   

return input;   

        },   

        getValue: function(target){   

return $(target).val();   

        },   

        setValue: function(target, value){   

            $(target).val(value);   

        },   

        resize: function(target, width){   

var input = $(target);   

if ($.boxModel == true){   

                input.width(width - (input.outerWidth() - input.width()));   

            } else {   

                input.width(width);   

            }   

        }   

    }   

});

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM