Associating A Dojoattachpoint To A Div Created Dynamically?
I want to create a div dynamically and want to attach a dojoAttachpoint. How can i do so? Following code is used to add a div dynamically, but i want to attach a dojoAttachpoint to
Solution 1:
Generally, you shouldn't need to. The dojoAttachPoint
's purpose to allow you to get an unambigious handle onto the div
within your dijit when it's declared declaratively (particularly important if you are creating more than one of your dijit on the same page).
However, because you are creating the div
dynamically, you already have the handle - in your case, the variable txt
. This will perform the same function. If you need it to become a property of your dijit, just create one:
this._myDivsPseudoAttachPoint = txt;
Solution 2:
As i know, you can use dojoAttachPoint only in widget template stringdojo-what-is-a-widget
dojoAttachPoint, dojoAttachEvent, waiRole, waiState attributes documentation
Post a Comment for "Associating A Dojoattachpoint To A Div Created Dynamically?"