#4205 closed defect (fixed)
add sugar to dojo.NodeList
Reported by: | alex | Owned by: | alex |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | Core | Version: | 0.9 |
Keywords: | Cc: | nathan, | |
Blocked By: | Blocking: |
Description
as discussed in this week's IRC meeting, add syntactic sugar to dojo.NodeList? to make event connection, style setting, and iteration easier. Should land for 0.9.
Attachments (1)
Change History (19)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
(In [10268]) start of some syntatic sugar for NodeLists?. Makes connecting to common events easier as well as changing css class names on a list. Refs #4205.
comment:3 Changed 13 years ago by
(In [10269]) allow dojo.forEach(), dojo.map(), and related functions to take strings as functions to execute. Need to investigate caching the resulting anonymous functions. Makes operating on NodeLists? much easier. Refs #4205
comment:4 Changed 13 years ago by
Are there any more changes for this, or was a "fixes" forgot in the checkin message?
-Karl
comment:5 Changed 13 years ago by
Status: | new → assigned |
---|
still need to add methods:
- attr
- removeAttr
- html (getContent?) setter/getter
comment:7 Changed 13 years ago by
comment:8 Changed 13 years ago by
comment:10 Changed 13 years ago by
comment:11 Changed 13 years ago by
comment:12 Changed 13 years ago by
comment:13 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
NodeList? is pretty sugary at this point. The only other major thing to land are Neil's behavior patches, but those are filed under separate cover.
comment:14 Changed 13 years ago by
Cc: | nathan added |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
OK - I don't know if reopening is the correct thing to do or not...but the changes in changelog [12899] breaks validation of dijit.form.Form.
For a test case, you can go to http://download.dojotoolkit.org/current-dev/dojo-release-1.1.0rc1/dijit/tests/form/Form.html and fill out an invalid date, and click on Submit. The validation will fail (it will tell you that the form is invalid) - but the form will submit anyway. There is no way to prevent the original form element from submitting.
If you change the dojo.connect on line 1092 to a node[name] = value, then everything is happy and it works as expected - that's roughly the way it used to work.
Can anyone shed any light on the reasoning behind that change?
Changed 13 years ago by
Attachment: | html.patch added |
---|
A patch which will revert to the previous behavior. This is NOT probably the desired solution, but for any who are having problems with form submission, this may be an interim fix.
comment:15 Changed 13 years ago by
It seems like the issue is calling the function via a dojo.connect - which makes it impossible to return false from the connected function to cancel the actual submit from happening. It seems that this would happen as well for other functions attached to html elements (onClick, onKeypress, etc).
comment:16 Changed 13 years ago by
Priority: | normal → high |
---|
comment:17 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
don't return false, dojo.stopEvent() on the passed event object.
Not a bug.
comment:18 Changed 13 years ago by
See #6299; we refactored Form to not use dojo.attr() and reinstated the ability to use "return false" as a way to cancel the form submit.
(In [10267]) start of checkins for syntatic sugar for dojo.NodeList?. This doesn't directly add sugar, but other methods will want/need dojo.connectPublisher(). Refs #4205