javascript - TinyMCE init fails after ajax refresh -
i'm using tinymce 4.1.10 enable inline editing on several divs on page. works fine on initial page load, if tear down editors , rebind textareas in ajax call tinymce won't hook them. binding done knockout.
here function loads data, , gets called when refresh occurs.
this.loadletterfields = function () { var editors = $("div.editable"); (var = editors.length - 1; > -1; i--) { var ed_id = editors[i].id; tinymce.execcommand("mceremoveeditor", false, ed_id); } $.getjson(_this.fieldurl + "/" + _this.letterid() + "/" + _this.clientid() + "/" + _this.caseid(), function (data) { (var = 0; < data.length; i++) { // reload fields } }); tinymce.init({ selector: "div.editable", inline: true, menubar: false, statusbar: false, toolbar: "bold italic underline | alignleft aligncenter alignright | bullist numlist outdent indent", forced_root_block: false }); }; i've pieced have several posts, seems recurring issue. there solutions? known bug?
update: noticed doesn't seem all of divs, there not difference in divs working , ones aren't. generated same ko if binding.
i ran similar issue. solution call tinymce.remove(); before calling reload. tinymce.init(); work expected.
Comments
Post a Comment