Replies: 3 comments
-
It looks like you're passing an array of objects to |
Beta Was this translation helpful? Give feedback.
-
Ok the solution proposed by @williamhakim10 works. In my database i saved data in json format, for example:
Can i use this string “as is” with insert method or I must extract data in blocks array and the insert in editor block by block ? There is a simple way to empty or destroy all text previously insert in the edit area and replace with new text ?
and work fine but I need retrieve the total number of blocks and then delete them with a for loop. |
Beta Was this translation helpful? Give feedback.
-
@MarcoZucc you can initialize editorjs with that JSON blob, see https://editorjs.io/configuration#passing-saved-data. I don't see an easy way to delete all data and replace it with new data short of iterating over the blocks and deleting them and then inserting new data using the method in my previous comment. |
Beta Was this translation helpful? Give feedback.
-
I have a problem when I try to update a block of text after its creation, this is my code:
I tried to update the block of text using:
editor_IT.blocks.insert(text_to_insert);
But don’t wok
The aim would be is:
create a block of text with "acbd" for example
If user check or uncheck the checkbox I’m going to update the text in the editor area.
Beta Was this translation helpful? Give feedback.
All reactions