繁体   English   中英

dijit contentpane包含附加点的内容

[英]dijit contentpane content containing attach points

像这样的东西:

var cp = new ContentPane({
                    title: self.friends_data.data[index].name,
                    closable: true,
                    onClose:function(){
                        conf = confirm("Do you really want to Close this?");
                        if (conf){
                            self.friends_tabs[index] = null;
                            return true;
                        }
                        return false;
                    },
                    content: newTabTemplate
                });

其中newTabTemplate是:

<div>
            <span data-dojo-type="dijit.layout.AccordionContainer" style="min-width: 1em; min-height: 1em; width: 100%; height: 100%;">
              <div data-dojo-type="dijit.layout.ContentPane" title="Write testimonial for friend" doLayout="false">
                <div data-dojo-type="dijit.Editor" data-dojo-attach-point="editor" data-dojo-props="onChange:function(){console.log('editor1 onChange handler: ' + arguments[0])}, extraPlugins:['foreColor','hiliteColor','fontName', 'fontSize', 'formatBlock', 'createLink', 'unlink', 'insertImage', {name: 'fullscreen', zIndex: 900}]" height=90% style=""></div>
                <!--
                dojo.connect(dijit.registry.byNode(editor1.toolbar.containerNode.children[editor1.toolbar.containerNode.children.length-1]), "onChange", function(x){alert('hello')});
              -->
              </div>
              <div data-dojo-type="dijit.layout.ContentPane" title="Read their testimonial for you" doLayout="false">
              </div>
            </span>
</div>

现在,我希望cp.editor工作,因为在cp的模板中有一个名为editor的附加点。 但它说undefined 可以解决吗?

实例化正确发生,即视觉输出正确,仅连接点不起作用。

将Widgets-in-template功能添加到cp作为混入,因为我认为ContentPane默认情况下不具有此功能。

https://dojotoolkit.org/reference-guide/1.8/dijit/_WidgetsInTemplateMixin.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM