Opened 15 years ago

Closed 15 years ago

#4549 closed defect (fixed)

style and class not copied during programmatic creation after applying [10527]

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

Description (last modified by bill)

After applying the attributeMap changes, neither style nor class are copied from the srcNodeRef during programmatic widget creation. So now:

<div dojoType="dijit.form.Button" label="hello" style="margin:9px;padding:9px;border:2px solid red;"></div>

renders differently than:

<div id="buttonContainer" style="margin:9px;padding:9px;border:2px solid red;"></div>
<script type="text/javascript">
        var params = {
                label: "hello"
        var widget = new dijit.form.Button(params, "buttonContainer");

when it was the same before [10527] was applied. It should be the same. This currently is causing the test_textarea.html programmatic example to render incorrectly.

There was code in _Templated.js to copy the style and class during buildRendering that was removed by [10527].

Change History (3)

comment:1 Changed 15 years ago by bill

Description: modified (diff)

Actually this is by design. New way of doing it is to specify style and class via javascript, like

new dijit.form.Button({ style: "position: absolute; left: 100px; ...",  "class": "myButton"};

But that should be documented in and also the test files should be updated.

comment:2 Changed 15 years ago by Douglas Hays

(In [10608]) References #4549. Moved style from srcNodeRef to programmatic parameters.

comment:3 Changed 15 years ago by Adam Peller

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.