首次初始化后,如何使tinyMCE编辑器保留在我的jQgrid textarea编码forms中?

我有一个jqgrid,我试图在文本区域中使用tinyMCE在我的数据库中发送/存储html并重新加载到我的网格。 我有一个带有tinyMCE的自定义列用于文本区域,但在我打开editform一次并在下次打开时关闭它,tinymce不会初始化并出现常规textarea。 (同样,当url模态失去焦点并专注于editform。文本被粘贴到后面的“Project”字段而不是(下图)。)我做错了什么?

我的TineMCE“链接”失去焦点的原因是因为语法错误。 我在editgrid代码中有modal:true。

工作在线编辑实现的更新以下是正确实现内联编辑的示例(谢谢@Oleg): DEMO1 | DEMO2

在线编辑工作代码示例:

{ name: "note", width: 260, sortable: false, editable: true, //edittype: "textarea" edittype:'custom', editoptions: { custom_element: function (value, options) { var elm = $(""); elm.val(value); // give the editor time to initialize setTimeout(function () { try { tinymce.remove("#" + options.id); } catch(ex) {} tinymce.init({selector: "#" + options.id, plugins: "link"}); }, 50); return elm; }, custom_value: function (element, oper, gridval) { var id; if (element.length > 0) { id = element.attr("id"); } else if (typeof element.selector === "string") { var sels = element.selector.split(" "), idSel = sels[sels.length - 1]; if (idSel.charAt(0) === "#") { id = idSel.substring(1); } else { return ""; } } if (oper === "get") { return tinymce.get(id).getContent({format: "row"}); } else if (oper === "set") { if (tinymce.get(id)) { tinymce.get(id).setContent(gridval); } } }} } 

url粘贴以编辑项目“项目”字段

jqGrid列:

          

 { name:'notes', index:'notes', edittype:'custom', editable:true, editoptions:{ "custom_element":function( value , options) { var elm = $(''); elm.val( value ); // give the editor time to initialize setTimeout( function() { tinymce.init({selector: "textarea#notes",plugins: "link"}); }, 100); return elm; }, "custom_value":function( element, oper, gridval) { if(oper === 'get') { return tinymce.get('notes').getContent({format: 'row'}); } else if( oper === 'set') { if(tinymce.get('notes')) { tinymce.get('notes').setContent( gridval ); } } }}} 

尝试将custom_element的代码替换为以下内容

 custom_element: function (value, options) { var elm = $(""); elm.val(value); // give the editor time to initialize setTimeout(function () { try { tinymce.remove("#" + options.id); } catch(ex) {} tinymce.init({selector: "#" + options.id, plugins: "link"}); }, 50); return elm; } 

还有一个简单