Problems with adding/removing ContentPanes in AccordionContainer

做~自己de王妃 提交于 2019-12-11 09:29:04

问题


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 another 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


回答1:


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.



来源:https://stackoverflow.com/questions/4081229/problems-with-adding-removing-contentpanes-in-accordioncontainer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!