How to Disable Editing in Summernotes?

后端 未结 3 1618
死守一世寂寞
死守一世寂寞 2021-02-13 02:46

I am using summernotes component and what I want to do is I want to stop the user from adding characters if s(he) exceeds 2000 Chars but I couldn\'t figure out how to stop typin

3条回答
  •  悲&欢浪女
    2021-02-13 03:33

    Look at this link from their official document.

    Basically, what you need to do is:

    You can disable editor by API.

    $('#summernote').summernote('disable');
    

    If you want to enable editor again, call API with enable.

    $('#summernote').summernote('enable');
    

    Now, what you can do is, use these API calls in your own code logic/algorithms to get the desired effect.

    I know its an old question, but hope this helps.

提交回复
热议问题