Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke summernote function #5

Closed
kamlesh0606 opened this issue Oct 14, 2018 · 7 comments
Closed

Invoke summernote function #5

kamlesh0606 opened this issue Oct 14, 2018 · 7 comments

Comments

@kamlesh0606
Copy link

Hi,

I need to invoke summernote function Like $('#summernote').summernote('editor.insertText', 'This text should appear at the cursor');

any option for this ?

I need to insert text at current cursor position , so
Ref. Link - summernote/summernote#282

Thanks
kamlesh

@lula
Copy link
Owner

lula commented Dec 18, 2018

Hello @kamlesh0606 ! Sorry for delay. You can use angular forms for this, like:

this.form.get('html').setValue("hello!")

@lula lula closed this as completed Dec 18, 2019
@kamlesh0606
Copy link
Author

Hello,

this.form.get('html').setValue("hello!") use for set value but i need to insert text at cursor position

have any way for this.

Thanks

@Rae-Lin
Copy link

Rae-Lin commented Aug 25, 2021

Hi @kamlesh0606,

I am also looking for this issue, did you find any solution?

Thanks.

@kamlesh0606
Copy link
Author

Hi @Rae-Lin , No

@VariableSan
Copy link

Greetings, @Rae-Lin @kamlesh0606
Has a solution been found?

@Rae-Lin
Copy link

Rae-Lin commented Oct 21, 2021

Hi @JudgementHC, maybe try this.

text: string;

editorInsertText() {
    $('#summernote').summernote('editor.saveRange');
    $('#summernote').summernote('editor.restoreRange');
    $('#summernote').summernote('editor.focus');
    $('#summernote').summernote('editor.insertText', this.text);
 }

@VariableSan
Copy link

Hi @JudgementHC, maybe try this.

text: string;

editorInsertText() {
    $('#summernote').summernote('editor.saveRange');
    $('#summernote').summernote('editor.restoreRange');
    $('#summernote').summernote('editor.focus');
    $('#summernote').summernote('editor.insertText', this.text);
 }

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants