Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#3058 closed enhancement (fixed)

Make passing of HTML elements into template more elegant

Reported by: Adam Peller Owned by: Adam Peller
Priority: high Milestone: 1.0
Component: Dijit Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

For example, templates must have name=${name} to carry over the name attribute from the original DOM node into the template, and a bogus default value must be supplied. For the textbox widgets, we have stuff like maxLength="999999". If maxLength isn't specified, it would be simpler not to define it.

Bill says we ought to be able to programmatically, in postCreate() just copy attributes to the focusNode instead of putting them in the template.

Attachments (2)

3058.patch (26.3 KB) - added by Adam Peller 12 years ago.
still needs more testing
3058.2.patch (26.9 KB) - added by Adam Peller 12 years ago.
combine style and class attributes; remove special cases from _Templated to do this. still needs more testing

Download all attachments as: .zip

Change History (23)

comment:1 Changed 12 years ago by Adam Peller

Status: newassigned

Changed 12 years ago by Adam Peller

Attachment: 3058.patch added

still needs more testing

Changed 12 years ago by Adam Peller

Attachment: 3058.2.patch added

combine style and class attributes; remove special cases from _Templated to do this. still needs more testing

comment:2 Changed 12 years ago by Adam Peller

Milestone: 0.91.0
Priority: normalhigh

Checked in changes to dijit/branches/attributemap. Deferring checkin until after 0.9 release.

comment:3 Changed 12 years ago by Adam Peller

(In [10468]) Deal with IE quirks for style, class. Refs #3058

comment:4 Changed 12 years ago by Adam Peller

(In [10469]) Deal with IE quirks for style, class. Refs #3058

comment:5 Changed 12 years ago by Adam Peller

(In [10476]) Rename styleNode to stateNode, put style mapping for textarea in genericMap Refs #3058

comment:6 Changed 12 years ago by Adam Peller

(In [10477]) raise attributemap branch from [10455] to [10476]. Refs #3058

comment:7 Changed 12 years ago by Adam Peller

(In [10485]) rename genericMap to attributeMap. Refs #3058

comment:8 Changed 12 years ago by Adam Peller

(In [10525]) raise attributemap branch revs from [10478] to [10524]. Refs #3058

comment:9 Changed 12 years ago by Adam Peller

(In [10527]) Merge attributemap branch. Still need to move style/class quirks from _Widget to parser, fix Slider,TextArea?,ComboBox?,FilteringSelect? widgets. Refs #3058

comment:10 Changed 12 years ago by Adam Peller

(In [10529]) TextArea?->Textarea, handle null values from parser. Refs #3058

comment:11 Changed 12 years ago by Adam Peller

(In [10530]) Handle "class" and "style" attributes according to IE quirks. Refs #3058

comment:12 Changed 12 years ago by Adam Peller

(In [10531]) fix typo, update attributeMap comment. Refs #3058

comment:13 Changed 12 years ago by Adam Peller

(In [10532]) rename node to mapNode, fix cssText access. Refs #3058

comment:14 Changed 12 years ago by bill

(In [10534]) Remove some unnecessary code that messing up diji.place()'s detection of the size of the dropdown (messing up Combobox drop down sizing). Refs #3058.

comment:15 Changed 12 years ago by bill

(In [10541]) Simplify attributeMap code and remove disabling for everything except Textarea (which causes an exception on Safari). Refs #3058.

comment:16 Changed 12 years ago by bill

(In [10543]) When the number of elements in the drop down list changes, height wasn't being adjusted. Need to set drop down list to it's natural height so that dijit.popup can suggest a proper height setting. Fixes #4482, refs #3058.

comment:17 Changed 12 years ago by Adam Peller

(In [10550]) Copy over native HTML FORM attributes. Refs #3058. Fixes #4392

comment:18 Changed 12 years ago by Adam Peller

(In [10552]) Tweak the class/style attribute handling to avoid setting cssText with += when it's null. Also, use dojo.addClass to avoid dups. Refs #3058

comment:19 Changed 12 years ago by Adam Peller

(In [10553]) remove redundant attribute settings in template. Refs #3058

comment:20 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: assignedclosed

#4519 remains, everything else seems ok.

comment:21 Changed 12 years ago by Adam Peller

(In [10568]) Don't copy over values with type of Date with attributeMap. Strings are most predictable, but let's stick to primitive types. Fixes #4497, refs #3058.

Note: See TracTickets for help on using tickets.