#9832 closed task (fixed)
Use dojo.cache() rather than templatePath
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dijit | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Convert the widgets to use templateString and dojo.cache(), like this:
templateString: dojo.cache("dijit", "templates/Calendar.html"),
instead of using templatePath:
templatePath: dojo.moduleUrl("dijit", "templates/Calendar.html"),
templatePath will still be supported for backwards-compatibility, but switching to use templateString across dijit will make it easier to subclass widgets since developers won't need to worry about the templatePath/templateString duality where code like
dojo.declare("myWidget", [superclass], templatePath: dojo.moduleUrl("dijit", "templates/Calendar.html"), ...
will fail if the superclass either directly defines templateString, or it's part of a build layer. In other words, using dojo.cache() eliminates the need for widgets to define both templatePath and templateString:
templatePath: dojo.moduleUrl("acme", "templates/MyCalendar.html"), templateString: null
See #9341 about dojo.cache() itself.
Change History (2)
comment:1 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 11 years ago by
Note: See
TracTickets for help on using
tickets.
(In [20022]) Convert widget code to use templateString: dojo.cache(...) rather than templatePath. Fixes #9832 !strict.