本文介绍了在AccordionContainer中添加/删除ContentPanes的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Dojo的新手,而我的目标是Adobe AIR。我
试图像这样将某些窗格放入AccordionContainer中:

I'm a complete newbie at Dojo, and Adobe AIR, which is my target. I'mtrying 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是我的AccordionContainer,而gtd_create_entry_widget()是:

"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;

}

该窗格显示在容器中,并带有正确的ID和标题,以及
没有错误,但是,如果我尝试添加另一个窗格,下一个窗格也会显示
,但是我得到了错误:

The pane shows up in the container, with the correct id and title, andno errors, however, if I try to add another pane, the next one showsup too, but I get the error:


TypeError:表达式'_7'的结果[未定义]不是对象。

如果我运行,也会遇到相同的错误

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 thismethod should destroy all the children.

如果需要,我可以提供完整的项目代码。

I can include full project code if required.

非常感谢

加里

推荐答案

我不确定这是否要解决您的问题,但是您应该将AccordianContainer与dijit.layout.AccordianPane(http://www.dojotoolkit.org/api/dijit/layout/AccordionPane.html)结合使用。

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.

这篇关于在AccordionContainer中添加/删除ContentPanes的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 23:37