Opened 14 years ago
Closed 13 years ago
#4177 closed defect (fixed)
non-zero insertIndex in programmatic TabContainer.addChild()
Reported by: | gizmojo.org | Owned by: | Adam Peller |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | Dijit | Version: | 0.9 |
Keywords: | inserIndex | Cc: | |
Blocked By: | Blocking: |
Description
FF2.0, W2k, Dojo rev 10182.
Doing addChild() on a programmatically created TabContainer? (but used an existing div element as target) starting the insertIndex count from 1 seems to work just fine.
However, doing the same on a programmatically created TabContainer? that uses a dynamically created div element as target, then starting the insertIndex from 1 gives a ref has no properties error.
A test file (plus some more description) to reproduce the problem is at: http://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/non-zero-insertindex-programmatic-tabcontainer-addchild
Attachments (1)
Change History (7)
comment:1 Changed 14 years ago by
Milestone: | → 1.0 |
---|---|
Owner: | set to Adam Peller |
Changed 13 years ago by
Attachment: | 4177.patch added |
---|
comment:2 Changed 13 years ago by
I think the test case should fail, but it should fail consistently. Inserting at position 1 when there is nothing at position 0 should result in an exception. The reason it succeeds the first time is because the unnormalized DOM has empty text nodes.
Container.addChild should be adding based on the # position of widgets, not nodes. I'm attaching a patch, but I need to work up a better test to make sure it's right.
comment:3 Changed 13 years ago by
Cool, looks good (well I haven't tried it but it look good), except that I think the query should be "> [widgetid]" not just "[widgetid]" since you only want to find children, not all descendants. See getChildren() function for an example.
comment:4 Changed 13 years ago by
Cc: | [email protected]… removed |
---|
comment:5 Changed 13 years ago by
Reporter: | changed from guest to gizmojo.org |
---|
comment:6 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [10715]) Fix addChild insertion into _Container and StackContainer? specifying index. Fixes #4177
insert at nth widget, not nth dom node