2014-12-08 35 views
1

我嘗試使用彈出窗口編輯項目jtable的ckeditor,但不出現。 和鉻瀏覽器不顯示錯誤,當我調試它。MVC.net 4如何在jtable彈出窗口中使用帶有textarea的ckeditor

這是我的代碼!我的textarea的名字是 「莫塔」

<script src="@Url.Content("~/Scripts/jtablescripts/jquery-1.9.0.min.js")" type="text/javascript"></script> 
 
<script src="@Url.Content("~/Scripts/jtablescripts/jquery-ui-1.9.2.min.js")" type="text/javascript"></script> 
 
<script src="@Url.Content("~/Scripts/ckeditor/ckeditor.js")"></script> 
 
<script src="@Url.Content("~/Scripts/ckfinder/ckfinder.js")"></script> 
 

 
<script type="text/javascript"> 
 
... 
 
    fields: { 
 
     MoTa: { 
 
     title: 'MoTa', 
 
        type: 'textarea', 
 
        list: false, 
 
        sorting: false, 
 
        formCreated: function (event, data) { 
 
         //$('textarea#Edit-MoTa').ckeditor(); 
 
         CKEDITOR.replace('MoTa', { toolbar: '1', htmlEncodeOutput: true }); 
 
        }, 
 
        formClosed: function (event, data) { 
 
         var editor = jQuery("textarea#Edit-MoTa").ckeditorGet(); 
 
         editor.destroy(); 
 
        } 
 
       } 
 
... 
 
</script> 
 

 

 
<script>CKEDITOR.replace('GhiChu', { toolbar: '1', htmlEncodeOutput: true });</script>
感謝幫助我

回答

1

檢查樣本代碼在這裏>>>

$('#templates').jtable({ 
 
\t \t \t title: 'Email Templates', 
 
\t \t \t paging: true, 
 
\t \t \t sorting: true, 
 
\t \t \t multiSorting: true, 
 
\t \t \t defaultSorting: 'TemplateCode ASC', 
 
\t \t \t actions: { 
 
\t \t \t \t listAction: '@Url.Action("List")', 
 
\t \t \t \t updateAction: '@Url.Action("Update")', 
 
\t \t \t \t createAction: '@Url.Action("Create")', 
 
\t \t \t \t deleteAction: '@Url.Action("Delete")' 
 
\t \t \t }, 
 
\t \t \t fields: { 
 
\t \t \t \t EmailTemplateID: { 
 
\t \t \t \t \t key: true, 
 
\t \t \t \t \t list: false 
 
\t \t \t \t }, 
 
\t \t \t \t TemplateCode: { 
 
\t \t \t \t \t title: 'Template Code' 
 
\t \t \t \t }, 
 
\t \t \t \t Subject: { 
 
\t \t \t \t \t title: 'Subject', 
 
\t \t \t \t }, 
 
\t \t \t \t Body: { 
 
\t \t \t \t \t title: 'Body', 
 
\t \t \t \t \t type: 'textarea', 
 
\t \t \t \t \t list: false 
 
\t \t \t \t }, 
 
\t \t \t \t SenderName: { 
 
\t \t \t \t \t title: 'Sender Name' 
 
\t \t \t \t }, 
 
\t \t \t \t SenderEmail: { 
 
\t \t \t \t \t title: 'Sender Email' 
 
\t \t \t \t } 
 
\t \t \t }, 
 
\t \t \t formCreated: function (event, data) { 
 
\t \t \t \t body = CKEDITOR.replace('Body', { width: '600px' }); 
 
\t \t \t \t $($(data.form.parent()).parent()).css('left', '300px'); 
 
\t \t \t \t $($(data.form.parent()).parent()).css('top', '30px'); 
 
\t \t \t \t data.form.find('input[name="TemplateCode"]').addClass('validate[required]'); 
 
\t \t \t \t data.form.find('input[name="SenderEmail"]').addClass('validate[custom[email]]'); 
 
\t \t \t \t data.form.validationEngine(); 
 
\t \t \t }, 
 
\t \t \t formSubmitting: function (event, data) { 
 
\t \t \t \t $('textarea#Edit-Body').val(body.getData()); 
 
\t \t \t \t return data.form.validationEngine('validate'); 
 
\t \t \t }, 
 
\t \t \t formClosed: function (event, data) { 
 
       data.form.validationEngine('hide'); 
 
       data.form.validationEngine('detach'); 
 
      }, 
 
\t \t \t animationsEnabled: isEnabled 
 
\t \t });

相關問題