使用 DOJO 开发定制小部件,第 1 部分: 使用通用的 markup 处理程序生成 DOJO markup
2010-05-13 00:00:00 来源:WEB开发网在 createComboBoxMarkup 方法中,markup 处理程序生成用于创建组合框小部件的 DOJO markup,见清单 3。
清单 3. createComboBoxMarkup 方法
createComboBoxMarkup: function(comboBoxSelectObject)
{
var FUNCTIONNAME = "createComboBoxMarkup()";
console.debug("Trace: " + "Class: " + this.CLASSNAME +
" Function: " + FUNCTIONNAME + " - Action: Entry");
optionStore = this._getOptionsStore(comboBoxSelectObject);
var props = {
name:this.widgetId+comboBoxSelectObject.id,
id:this.widgetId+comboBoxSelectObject.id,
dojoAttachPoint:this.widgetId+comboBoxSelectObject.id,
store: optionStore,
searchAttr:""+comboBoxSelectObject.searchAttr,
labelAttr:""+comboBoxSelectObject.labelAttr,
maxLength: this._getMaxLengthField
(comboBoxSelectObject.maxlength),
required: this._getRequiredField
(comboBoxSelectObject.required),
style: comboBoxSelectObject.style,
invalidMessage: this._getNLSMessage
(comboBoxSelectObject.invalidMessage),
promptMessage: this._getNLSMessage
(comboBoxSelectObject.promptMessage)
};
this.comboBox = new dijit.form.ComboBox(props,
this._getDivElement(comboBoxSelectObject));
this.comboBox._setClassAttr
(this._getObjectClass
(comboBoxSelectObject.cssclass,
comboBoxSelectObject.style));
this.comboBox.setValue(comboBoxSelectObject.value);
this._configureScriptHitch(this.comboBox,comboBoxSelectObject);
this.objectsList.add(this.objectsList.count,this.comboBox);
console.debug("Trace: " + "Class: " + this.CLASSNAME + " Function: " +
FUNCTIONNAME + " - Action: Exit");
}
更多精彩
赞助商链接