开发者

Problems with adding/removing ContentPanes in AccordionContainer

I'm a complete newbie at Dojo, and Adobe AIR, which is my target. I'm trying to put some panes into an AccordionContainer like so:

var mainview = dijit.byId("mainview");
var rand = randomString();
var widg = gtd_create_entry_widget(rand)
air.trace(mainview);
air.trace(widg);
mainview.addChild(widg);

"mainview" is my AccordionContainer, and gtd_create_entry_widget() is:

function gtd_create_entry_widget(id) {

   var entry = new dijit.layout.ContentPane();
   entry.attr("id",id);
   entry.attr("title","title "+id);
   return entry;

}

The pane shows up in the container, with the correct id and title, and no errors, however, if I try to add a开发者_如何学Gonother pane, the next one shows up too, but I get the error:

TypeError: Result of expression '_7' [undefined] is not an object.

I get the same error if I run

var mainview = dijit.byId("mainview");
mainview.destroyDescendants();

and also, only one pane is destroyed at a time, and I understand this method should destroy all the children.

I can include full project code if required.

Thanks a lot

Garry


I'm not exactly sure if this is going to fix your problem, but you're supposed to use dijit.layout.AccordianPane (http://www.dojotoolkit.org/api/dijit/layout/AccordionPane.html) with the AccordianContainer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜