dojo 1.8: loading dojo-laced html files into contentpane

拥有回忆 提交于 2019-12-11 19:09:31

问题


Hi Any idea how I can load dojo-laced html file dynamically into contentpanes?

I am able to load non-dojo html into content pane using href.

When I loaded dojo-laced html file, I can see text in html tags but not text in dojo scripts. Where did I go wrong?

The scripts I put here are:-

widget.set('href','dojotext.html')

Another problem in jsfiddle is that pressing button 1 will not update, unlike in my environment.

and funny thing is that border container and comtent panes are not displayed, unlike in my environment too.

Here are my links in jsfiddle - main page for testing loading - dojo content to be loaded

Please advise. Thanks Clement


回答1:


First of all, your ContentPanes and BorderContainer are not being displayed because you're not parsing them.

In your code, you can run parser manually:

ready(function () {
    parser.parse();
    // ...
});

Regarding your first question, it seems that you didn't read the documentation:

<div id="foo" data-dojo-type="dijit/layout/ContentPane" href="/some/page.html">
  <script type="dojo/method">
    alert ('Hello World!');
  </script>
</div>

Code from: ContentPane documentation



来源:https://stackoverflow.com/questions/14493506/dojo-1-8-loading-dojo-laced-html-files-into-contentpane

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