dijit.form - How to make a Dojo dijit form programmatically -
im new dojo , im trying make ui, using programmatic way.
i if show me example of how make form programmarically using dojo dijit.form.form. i've been looking example can find declarative way of it.
a more object oriented solution:
define( [ "dojo/_base/declare", "dijit/form/form", "dijit/form/textarea", "dijit/form/button" ], function(declare, form, textarea, button) { return declare( "mypackage.myform", form, { textarea: new textarea({}), submitbutton: new button({ type: "submit", label: "ready!" }), constructor: function(args) { declare.safemixin(this, args); }, onsubmit: function() { alert(this.textarea.get('value')); }, postcreate: function() { this.domnode.appendchild( this.textarea.domnode ); this.domnode.appendchild( this.submitbutton.domnode ); } }); } );
just drop new mypackage.myform({})
@ place might expect widget.
Comments
Post a Comment