[Dojo-interest] dijit template in html, but no as dijit.Declaration

sam foster potatosculptor at gmail.com
Wed Mar 24 18:16:25 EDT 2010


In this case you may be able to get this to work by keeping your
dijit._Templated mixin, but adding:

postMixInProperties: function() {
        this.inherited(arguments);
	this.templateString = this.srcNodeRef.innerHTML;
},

That tells the templating mechanism to use the markup as the template.
But note that the markup is still replaced by the template's output,
and in a case where a widget was a container - like say ContentPane or
TabContainer kind of widget - you would get in a pickle as the source
content and template are trampling on each other.

I worked some on an alternative "templating" mechanism, discussed in
http://bugs.dojotoolkit.org/ticket/10800 which might be of interest if
this model of markup->widget is important to you, letting you bind
existing nodes in the DOM and hook up events without the DOM creation
and switcheroo that dijit._Templated does.

/Sam

On Wed, Mar 24, 2010 at 8:42 PM, Kaare A. Larsen <kaare at sogeocompany.com> wrote:
>
> hey there,
> i am pretty new to dojo, but well i am start playing with dijit, and are
> trying to create a "custom search widget", but well the problem is that i
> want the search form to be in html, and not loaded in as js in the
> templateString.


More information about the Dojo-interest mailing list