/*
* author:sjbwylbs,email:sjbwylbs@163.com
*/
dojo.provide("ijqg.utils.FormHelper");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.Button");
dojo.declare("ijqg.utils.FormHelper",[],{
className : "FormHelper",
constructor:function(className)
{
this.className=className;
},
addButton : function(pane,name,action) {
var button = new dijit.form.Button({
label : name
});
pane.appendChild(button.domNode);
button.onClick = action;
return button;
},
addSpan : function(pane,title) {
var dom= dojo.create("span",{
id : this.className + name,
innerHTML : title
});
pane.containerNode.appendChild(dom);
return dom;
},
addInput : function(pane,name) {
var dom= dojo.create("input",
type : "text"
});
pane.containerNode.appendChild(dom);
return dom;
},
addContentArea : function(name) {
return dojo.create("div",
className : "dijitDialogPaneContentArea formItem"
});
},
addActionBar : function(form,name) {
var dom = dojo.create("div",
className : "dijitDialogPaneActionBar formItem"
});
form.containerNode.appendChild(dom);
return dom;
},
addLabel : function(name,htmlFor) {
return dojo.create("label",{
innerHTML : name,
htmlFor : htmlFor
});
},
addFormArea : function(form,title) {
var dom = this.addContentArea(name);
dom.appendChild(this.addLabel(title,name));
form.containerNode.appendChild(dom);
return dom;
}
});
原文链接:https://www.f2er.com/dojo/291629.html