But if I came back to the content and check for bodyManiraj content, It gives empty value only,
Sorry couldn’t include that textarea showing no value image as I am new user restricted with replies and image uploading, but I hope you can get the view that no value is there inside textarea of bodyManiraj.
(Refer previous image where table is there instead of that there is a empty <p> </p> tag alone with <br /> statement inside it but the data we entered is saved and available in API tab)
Could you please help me in any squidex Function/Method to load data in editor after page refresh.
What actually I am doing wrong here and how to make the saved content append to the textarea?
var field = new SquidexField();
tinymce.init({
setup: (editor => {
editor.on('init', () => {
// Subscribe here. The onValueChanged might be called directly with the current value.
field.onValueChanged(function (value) {
editor.setContent(value || '');
});
// Subscribe here. The onValueChanged might be called directly with the disabled state.
field.onDisabled(function (disabled) {
editor.setMode(disabled ? 'readonly' : 'design');
});
});
editor.on('change', () => {
const value = editor.getContent();
field.valueChanged(value);
});
editor.on('blur', () => {
field.touched();
});
}
});
NEVER ever communicate with the underlying textarea.
Also can you verify whether it is var field = new SquidexField(); ?? If I gave SquidexField then it gives error and SquidexFormField doesn’t throw error but expected result is not achieved either way…
Please take a look at the editor and kindly please check for the changes I have made and let me know your feedback on it.
Also the above code changes doesn’t allow to make any change and save which works previously…
Yes @Sebastian , I have just done few cleanup work and it works fine now and now able to save the content and also able to retrieve the content on page load and very big thanks for your help…
Once again thanks @Sebastian … But the above gives me error as Uncaught ReferenceError: myHtml is not defined … If I give like editor.execCommand('mceInsertContent',false,'<b>Hello world!!</b>'); inside init method then there is no error but it also doesn’t show the pinterest post inside the editor… Again link for the same implementation: https://repl.it/@ManirajVanna/tinymcevanna#index.html
Also user will add the html <a href="https://www.pinterest.com/pin/192740059037785029" data-pin-do="embedPin"> </a> via View => Source Code in the toolbar using the editor…
Yes I got that and changed it like '<b>Hello world!!</b>' but still no luck… If you can help me what exact change should I need to make in tinymce then that would be really a great help @Sebastian…
You are right but I have tried like editor.execCommand('mceInsertContent',false,'<b>Hello world!!</b>'); inside init method but that doesn’t resolve the issue… And I am very new to squidex, So seeking your help…
Still it doesn’t work when we include <a href="https://www.pinterest.com/pin/192740059037785029" data-pin-do="embedPin"> </a> via View => Source Code (Using editor toolbar)… It is displaying Hello World if we click on Click Me… But expectation is that user will add this above a tag using toolbar View => Source Code…
But there is no answers yet… If you have any clue on how to make it working then that would be great @Sebastian … Still your help is highly appreciable for previous conversations…