I'm using inline Editor.
I need to save the editor data into an HTML file and eventually reload the HTML file in the editor to modify it more times.
This is part of my aspx page.
<form id="form1" runat="server">
<div id="example" class="k-content">
<div id="editor" class="demo-section">
<div id="topEditor">
<p>Title</p>
</div>
<div contentEditable class="column">
<p> Description </p>
</div>
</div>
</div>
</form>
And this are the code I used to inizialized editor
$(document).ready(function () {
$("#topEditor").kendoEditor({
tools: [
"bold",
"italic",
"underline"]
});
$(".column").kendoEditor({
tools: [
"bold",
"italic",
"underline",]
});
}
Since I don't initialize $("#editor").kendoEditor() the code
var editor= $('#editor').data("kendoEditor")
gives me an undefined value of variable 'editor' and I can't retrieve its content value.
Instead, if i use
$('#editor').find("div").each(function () {
var editor = $(this).data("kendoEditor");
html += editor.value();
});
I've the right content of each <div> .
The HTML I obtain is:
<p>Title</p><p>Description </p>
but 'cause it doesn't contain <div> element I can't reload it into editor and have the originally document.
There's a simple way to get HTML editor data in the right format that I can re-load in the inline editor more times?
Thanks
I need to save the editor data into an HTML file and eventually reload the HTML file in the editor to modify it more times.
This is part of my aspx page.
<form id="form1" runat="server">
<div id="example" class="k-content">
<div id="editor" class="demo-section">
<div id="topEditor">
<p>Title</p>
</div>
<div contentEditable class="column">
<p> Description </p>
</div>
</div>
</div>
</form>
And this are the code I used to inizialized editor
$(document).ready(function () {
$("#topEditor").kendoEditor({
tools: [
"bold",
"italic",
"underline"]
});
$(".column").kendoEditor({
tools: [
"bold",
"italic",
"underline",]
});
}
Since I don't initialize $("#editor").kendoEditor() the code
var editor= $('#editor').data("kendoEditor")
gives me an undefined value of variable 'editor' and I can't retrieve its content value.
Instead, if i use
$('#editor').find("div").each(function () {
var editor = $(this).data("kendoEditor");
html += editor.value();
});
I've the right content of each <div> .
The HTML I obtain is:
<p>Title</p><p>Description </p>
but 'cause it doesn't contain <div> element I can't reload it into editor and have the originally document.
There's a simple way to get HTML editor data in the right format that I can re-load in the inline editor more times?
Thanks