EasyUI Forum
April 20, 2024, 01:11:25 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: some trouble about window load remote url (include editor)  (Read 8406 times)
zh_CN
Newbie
*
Posts: 32



View Profile Email
« on: April 04, 2014, 01:13:39 AM »

Code:
function openWindow(cate_id,model_id){
    $('#w').window('refresh', '/admin.php?s=/Article/add/cate_id/'+cate_id+'/pid/0/model_id/'+model_id);
    $('#w').window('open');
}
the editor is not loaded! see the Attache: 1.jpg
the html
Quote
                               <textarea name="content"></textarea>
                                      <input type="hidden" name="parse" value="0">
      <link rel="stylesheet" href="/Public/static/kindeditor/default/default.css" />
         <script charset="utf-8" src="/Public/static/kindeditor/kindeditor-min.js"></script>
         <script charset="utf-8" src="/Public/static/kindeditor/zh_CN.js"></script>
         <script type="text/javascript">
            var editor;
            KindEditor.ready(function(K) {
               editor = K.create('textarea[name="content"]', {
                  allowFileManager : false,
                  themesPath: K.basePath,
                  width: '100%',
                  height: '500px',
                  resizeType: 1,
                  pasteType : 2,
                  urlType : 'absolute',
                  fileManagerJson : '/admin.php?s=/Article/fileManagerJson.html',
                  //uploadJson : '/admin.php?s=/Article/uploadJson.html' }
                  uploadJson : '/admin.php?s=/Addons/execute/_addons/EditorForAdmin/_controller/Upload/_action/ke_upimg.html'
               });
            });

            $(function(){
               //传统表单提交同步
               $('textarea[name="content"]').closest('form').submit(function(){
                  editor.sync();
               });
               //ajax提交之前同步
               $('button[type="submit"],#submit,.ajax-post').click(function(){
                  editor.sync();
               });
            })
         </script>


« Last Edit: April 04, 2014, 01:15:58 AM by zh_CN » Logged

From the great China
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 04, 2014, 02:05:32 AM »

Please try to delay a little time before initializing your editor instance.
Code:
<script>
$(function(){
setTimeout(function(){
KindEditor.create('textarea[name="content"]');
},0)
})
</script>
Logged
zh_CN
Newbie
*
Posts: 32



View Profile Email
« Reply #2 on: April 05, 2014, 12:47:25 AM »

Please try to delay a little time before initializing your editor instance.
Code:
<script>
$(function(){
setTimeout(function(){
KindEditor.create('textarea[name="content"]');
},0)
})
</script>

Now, the code in KindEditor.ready(function(K) {})  can't run (I sure this),!

So i use KindEditor.create('textarea[name="content"]') , Then i't can be loaded, but don't be editing, the editor is readonly.
There may be conflicts

« Last Edit: April 05, 2014, 12:50:17 AM by zh_CN » Logged

From the great China
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!