How to programmatically toggle between HTML source and preview

When using the RichtextEditor VUE component, I can easily switch from viewing the HTML preview to showing the actual HTML source code using something like

this.$refs.defaultRTE.showSourceCode();

But I did not find a method that gets me back into preview mode. When using the toolbar of the editor, it has the option to toggle between preview and HTML source. how can  I do the same programmatically?

1 Reply 1 reply marked as answer

SD Suwathi Dhakshanamoorthy Syncfusion Team September 5, 2020 01:30 AM UTC

Hi Helmut, 
  
  
Greetings from Syncfusion support. 
  
  
We have validated your reported query “ method that gets me back into preview mode” from our end. We don’t have a built-in method that gets back from `sourceCode` mode to `preview mode`. 
But, you can achieve your requirement by dispatch a `click` event to the preview element. We prepared a demo sample based on your requirements and updated below. 
  
  
Please refer to the above sample and confirm whether it meets your requirements. 
  
Regards, 
Suwathi 


Marked as answer
Loader.
Up arrow icon