Discussion:
[Dojo-interest] use buildRendering for creating and placing in to dom
computerbum
2014-05-04 13:38:01 UTC
Permalink
Hello all,

I am just making sure that I understand how to use buildRendering.



I created a widget that does not use a template it just creates a couple of
nodes and places them in the dom using domConstruct.place().

At first, I created all my nodes in postCreate but I need to create the
nodes before postCreate gets called so I decided to build and attach the
nodes in buildRendering which does what I want.

My question is, is this the right place to do this?

a little sample of the code:

buildRendering: function() {
this.inherited( arguments );

// at first I created all my node in postCreate but decided to put it here
this.label = domConstruct.place( '<label> New Account</label>',
this.accountRadioBtn.domNode, 'after');
},

postCreate: function() {
this.inherited( arguments );
}





--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/use-buildRendering-for-creating-and-placing-in-to-dom-tp4002157.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
W.S. Hager
2014-05-04 20:47:55 UTC
Permalink
Your mail is possibly considered spam because of your nick.

http://dojotoolkit.org/reference-guide/1.9/dijit/_WidgetBase.html

I'd say yes.
Post by computerbum
Hello all,
I am just making sure that I understand how to use buildRendering.
I created a widget that does not use a template it just creates a couple of
nodes and places them in the dom using domConstruct.place().
At first, I created all my nodes in postCreate but I need to create the
nodes before postCreate gets called so I decided to build and attach the
nodes in buildRendering which does what I want.
My question is, is this the right place to do this?
buildRendering: function() {
this.inherited( arguments );
// at first I created all my node in postCreate but decided to put it here
this.label = domConstruct.place( '<label> New Account</label>',
this.accountRadioBtn.domNode, 'after');
},
postCreate: function() {
this.inherited( arguments );
}
--
http://dojo-toolkit.33424.n3.nabble.com/use-buildRendering-for-creating-and-placing-in-to-dom-tp4002157.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
deepakanand
2014-05-04 20:52:40 UTC
Permalink
Oh and btw, you dont need to define a lifecycle method and call super, if you
are not overriding a default behavior
I am referring to your code snippet which defines a postCreate and does a
this.inherited(arguments)



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/use-buildRendering-for-creating-and-placing-in-to-dom-tp4002157p4002160.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
computerbum
2014-05-05 13:51:56 UTC
Permalink
Ok, thanks

I appreciate you taking the time to answer my question



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/use-buildRendering-for-creating-and-placing-in-to-dom-tp4002157p4002172.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.

Loading...