[英]Custom widget defined in an HTML page loaded as dojox.layout.contentpane using href and inserted as tab page not parsing custom widgets
I was trying to add a new tab page using tab.addchild
programmatically after creating dojox.layout.contentpane
with href
attribute. 在尝试使用
href
属性创建dojox.layout.contentpane
之后,我尝试以编程方式使用tab.addchild
添加新的标签页。
Following is the sample snippet of the relevant code ( tabMain
is tab control placed in the page) 以下是相关代码的示例代码片段(
tabMain
是放置在页面中的Tab控件)
dijit.byId('tabMain').addChild(new dojox.layout.ContentPane({
title: 'My page',
href: 'country.jsp',
closable: true,
parseOnLoad: true,
postCreate: function () {
dojo.parser.parse();
}));
This country.jsp
has custom widget (that contain two standard dijit widgets). 此
country.jsp
具有自定义小部件(包含两个标准dijit小部件)。
But the custom widgets are not parsed and hence I am not getting the custom widget properly loaded, where as other standard dijits mentioned in the country.jsp
loads perfectly. 但是自定义窗口小部件没有被解析,因此我无法正确加载自定义窗口小部件,就像
country.jsp
提到的其他标准dijit完美加载一样。
To rule out the problem with my page and custom widget declarations, I put this custom widget directly in a page without loading inside a contentpane/tab (and loaded inside as dialog page), it works fine. 为了排除页面和自定义窗口小部件声明的问题,我将此自定义窗口小部件直接放置在页面中,而无需在contentpane / tab内部加载(并在内部以对话框页面的形式加载),效果很好。 So, I assume that the dojo parser is not parsing the custom widget, when I load it in the content pane as shown in the above code.
因此,当我将其加载到内容窗格中时,我假设dojo解析器没有解析该自定义窗口小部件,如上面的代码所示。
Does this mean, custom widget cannot be used for such type of loading or Am I missing anything extra to force the parser to work? 这是否意味着自定义窗口小部件无法用于这种类型的加载,或者我是否缺少任何其他东西来强制解析器正常工作? I tried running parser on load, downloadend, downloadstart, ready events, but with no luck.
我尝试在加载,下载结束,下载开始,就绪事件上运行解析器,但是没有运气。
Any help would be appreciated. 任何帮助,将不胜感激。
Without knowing anything about DOJO, your provided snippet is missing a closing bracket inside the ContentPane
constructor call, making it invalid (and thus not parsable). 在不了解DOJO的情况下,您提供的代码段缺少
ContentPane
构造函数调用内的ContentPane
括号,从而使其无效(因此不可解析)。
Try: 尝试:
dijit.byId('tabMain').addChild(new dojox.layout.ContentPane({
title: 'My page',
href: 'country.jsp',
closable: true,
parseOnLoad: true,
postCreate: function () {
dojo.parser.parse();
}
}));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.