You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.2 KiB

4 years ago
/**
* 编辑控件共通处理文件
* @description [description]
* @version 1.0
*/
define(function (require, exports, module) {
var Editors = require('./editors')
function getEditor(type) {
var Editor = null;
switch (type) {
case '00': //00-文本
Editor = Editors.Text;
break;
case '01': //01-按钮文本
Editor = Editors.Reference;
break;
case '02': //02-下拉选择
Editor = Editors.Combobox;
break;
case '03': //03-复选框
Editor = Editors.Checkbox;
break;
case '04': //04-时间日期
Editor = Editors.DateTime;
break;
case '05': //05-日期
Editor = Editors.Date;
break;
case '07': //06-时间
Editor = Editors.Time;
break;
case '07': //07-自动完成
break;
case '08': //08-按钮
break;
case '09': //09-超链接
break;
case '10': //10-下拉表格
Editor = Editors.Combogrid;
break;
case '11': //11-大文本
Editor = Editors.Textarea;
break;
case '12':
Editor = Editors.Password;
break;
case '13':
Editor = Editors.Decimal;
break;
case '14':
Editor = Editors.NewDate;
default:
break;
}
return Editor;
}
function getEditorInstance(type, args) {
var Editor = getEditor(type);
return new Editor(args);
}
function getEditorArgs(container, column) {
return new EditorArgsAdapter(container, column);
}
function EditorArgsAdapter(container, column) {
this.grid = null;
this.gridPosition = null;
this.position = null;
this.container = container;
this.column = column;
}
return {
getEditor: getEditor,
getEditorArgs: getEditorArgs,
getEditorInstance: getEditorInstance
}
})