Drag and drop text block to open document

Hello, is it possible to drag-n-drop text blocks to document editor in vue component?
like here https://stackblitz.com/edit/angular-kncnqt-zd3pn4?file=app.component.html
but in document editor. I insert it but it's don't convert to html 

this.$refs.doceditcontainer.ej2Instances.documentEditor.insertText(sfdt);


4 Replies

HC Harini Chellappa Syncfusion Team March 2, 2020 09:04 AM UTC

Hi Olga, 

Syncfusion Greetings! 

Please find the details of your query from below table. 

For drag and drop text contents inside document editor 
Please refer the below KB which is in ASP.NET MVC. please check whether this KB satisfies your requirement and let us know if you need the same sample in vue? 
 
 
I insert it but it's don't convert to html  
Can you please share your requirement clearly? 
 
Do you want to insert it as text or to open the sfdt text? Since insertText API inserts specified string in current selection without any conversion. 
 
If you want to open with SFDT string, then please refer the below API. 
 
Sample code snippet 
 
containerInstance.documentEditor.open(sfdtString) 
  
Please refer the below documentation on importing sfdt string in document editor. 
 
 

Regards, 
Harini C 



AL Alexey March 2, 2020 09:42 AM UTC

I want to drag and drop one sfdt file to already opened file. If I use open, it just open new file, but I want to insert it. So I've got json(sfdt) string and I want to insert it as text to opened file. Something like documenteditor.parser.convertJsonToDocument 


HC Harini Chellappa Syncfusion Team March 2, 2020 11:48 AM UTC

Hi Olga, 

Thank you for the update. 

Using paste(sfdtstring) API in editor module, you can insert a document (extracts the document and insert contains paragraph and table) at current cursor position. 

Please refer the below documentation on paste API 


Sample code snippet 

DocumentEditorContainer 
 
//pass the sfdt string, which extracts the document and inserts paragraph and table with its properties  
containerInstance.documentEditor.editor.paste(sfdtstring) 
 
DocumentEditor 
documentEditorInstance.documentEditor.editor.paste(sfdtstring) 
 
 


Regards, 
Harini C 



AL Alexey March 2, 2020 03:12 PM UTC

Thanks, it work fabulous! 

Loader.
Up arrow icon