Opened 10 years ago
Closed 10 years ago
#13426 closed defect (fixed)
dojox/dtl/demos broken in 1.7
Reported by: | Chris Mitchell | Owned by: | Neil Roberts |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | DojoX DTL | Version: | 1.7.0b1 |
Keywords: | Cc: | Ed Chatelain, ben hockey | |
Blocked By: | Blocking: |
Description
Running any of the dojox/dtl/demos in a browser results in: "load" is not a function
Attachments (1)
Change History (14)
comment:1 Changed 10 years ago by
Cc: | Ed Chatelain added |
---|---|
Keywords: | [email protected] removed |
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
Cc: | ben hockey added |
---|
comment:4 Changed 10 years ago by
While working on the dtl/demos I found the following problems with the dtl code. dojox.dtl._base.js - was missing define for "dojo/_base/Deferred", and had to change xhr.xhrGet() to xhr.get() dojox.dtl._DomTemplated.js - had to change cache.cache() to cache(). dojox.dtl._Templated.js - had to define dijit/_TemplatedMixin instead of dijit/_Templated, and had to add a function to the call to attachTempalteNodes. dojox.dtl.contrib.dom.js - change from domStyle.style() to domStyle.set().
And I made the following updates to the demos: dojox/dtl/demos/demo_Data.html - was missing a dojo.require for dijit._Widget. dojox/dtl/demos/demo_Table.html - was missing a dojo.require for dijit._Widget. dojox/dtl/demos/demo_Templated.html - was missing a dojo.require for dijit._Widget.
dojox/dtl/demos/templates/blog_base.html, blog_list.html and blog_page.html - had to remove the <!-- --> from around this line: {% load dojox.dtl.contrib.dom %} But I am not sure why this was necessary, it worked in 1.6 with the <!-- --> around it...
I will attach the patch with these updates.
Changed 10 years ago by
Attachment: | dtl-13426Patch added |
---|
These updates are described in the comments, if someone could take a look at them and commit them if they look ok, I would appreciate it.
comment:5 Changed 10 years ago by
wondering if _WidgetBase should be used instead of _Widget, also whether there's some loader routine hanging off require which could replace the dojo.cache
comment:6 Changed 10 years ago by
how about changing _Widget to _WidgetBase and then apply the patch and we can consider replacing dojo.cache after the beta is built?
comment:8 Changed 10 years ago by
Hi Adam,
Thanks for committing my patch and for making the other updates to dtl.
I found one problem with the updates to dtl/_base which are causing a few test failures for things which were working ok with just my patch. The change you made in the get: function(key, otherwise) You changed:
if(typeof this[key] != "undefined"){
return n(this[key]);
}
To this:
if(this[key] != undefined){
return n(this[key]);
}
The problem is happening when this[key] is null, and the typeof this[key] is an object, the old test would pass (and return n(this[key])) , but your test is failing and going on to the return otherwise; So you can either change back to the typeof or change to also allow null. Thanks, Ed
comment:11 Changed 10 years ago by
Ed, is this ticket good to close? I image there are a lot of DTL issues but as far as what this ticket is meant to cover.
comment:12 Changed 10 years ago by
Yes this ticket can be closed, the demos and the tests are running successfully now. I want to do some async testing, but any updates for that can be done on the dojox amd ticket 12863.
comment:13 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
the cache thing should be investigated, but that too could go under #12863
It looks like many of the demos are missing: dojo.require("dijit._Widget");
And some also need to remove the comments around: {% load dojox.dtl.contrib.dijit %} It looks like the load was commented out with this comment, but maybe that is no longer the case? Note, the load tag here is superfluous, since _DomTemplate has a dojo.require for it.
I will try to create a patch tomorrow, there is still 3 failing after the above changes, which I need to work on demo_Templated.html, and demo_Table.html and demo_Data.html