Hi !
Not an issue but a question : I've not yet installed tui.editor and I'm really interested too try it but ... how can we save the content on the server ?
I'm actually using Simple MDE, we can attach on the toolbar a "save" button, retrieve the content of the
Can we does something like that with tui.editor ? Can you provide tips or documentation ?
Many thanks !!!
Christophe
It just replaces a form-element or div etc. You can save your data like you prefer doing it with other input elements
Thanks for the very fast answer.
So, to take a real example, on the demo page (https://nhnent.github.io/tui.editor/), I click on the "Features" div, type something and see in the DOM inspector that the change is done in the div with class "te-editor" like :
<div class="te-editor" style="position: relative;">
<div contenteditable="true">
<h1>
<div>
<span class="colour" style="color:rgb(75, 148, 229)">Features MY CHANGES</span>
</div>
</h1>
Should I foresee a .onChange() js function on that DOM elem to retrieve the change ? (how can I very quickly remove the "
Thanks
I hope this helps you out:
const Editor = TuiEditor.factory({
el: this.el,
height: 'auto',
initialValue: determineValue(this.props),
initialEditType: 'wysiwyg',
events: {
change: this.onChange,
focus: () => onFocus(),
blur: () => onBlur(),
},
})
then for example in your onChange method, youd do this:
const value = Editor.getMarkdown();
or
const value = Editor.getHtml();
@skerbis @michaelryancaputo Thanks guys. I see we have good contributors 💯
@cavo789 in addition, you can check out API Docs constructor options
I'm closing it.
Thank you guys !!! Thank you Michael for your js code 👍
Thank you guys!!
Most helpful comment
I hope this helps you out:
then for example in your onChange method, youd do this:
or