2010-05-09 71 views
1

嗨專家,請幫我解決dijit.Editor的疑問。在頁面加載後添加dijit.Editor

我想使用jQuery將dijit.Editor動態添加到我的頁面中。

我的代碼是:
jQuery(#foo).before("<textarea width='500px' name='page_text2[]' dojoType='dijit.Editor' ></textarea>");

textarea的被創建,但dijit.Editor不顯示。

看來dojo只解析元素onLoad。

是否可以在頁面加載完成後即時插入dojo元素?

我錯過了什麼?

謝謝。

+0

現在看來,這需要使用dojo.parser.parse - 但它不工作:( – Fernando 2010-05-09 20:45:23

+1

解決(單獨)..嘿嘿 dojo.parser.parse到div而不是小部件中使用。 :) – Fernando 2010-05-09 21:59:02

回答

1
    var editor= new dijit.Editor({ 
        name : 'editor_name', 
       }, dojo.byId('id_editor'));