quill html editor

quill html editor

LapointeLapointe Posts: 430Questions: 81Answers: 4

hi

I use quill to edit some field.

Field is disabled but quill allow to edit content...

Does somebody know how to disallow quill editing

Thanks

Bob

Replies

  • colincolin Posts: 15,179Questions: 1Answers: 2,590

    Would you be able to modify this test case here, please, to demonstrate the problem, or link to your page. It would help understand what's going on,

    Colin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @colin
    Thank

    Yes, but where is 'here' please (no link provided) ?

    editor
        .......
        .disable()
        .edit() // allow quill content to be edited while control is disabled
    
    

    //html
    As you can see for textarea

    but quill input do not have disable set

    and have a property set to

    <

    div class="ql-editor ql-blank" data-gramm="false" contenteditable="true">

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794
    edited February 2021

    Here is a similar question about CKEditor. You may need to look at quill docs to see how to make it read only.

    Kevin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi kevin
    this way (I think) : div class="ql-editor ql-blank" .... contenteditable="false">

    But hope there is a way in fields type setting to solve problem as a class extension, not coding each control that use quill...

  • colincolin Posts: 15,179Questions: 1Answers: 2,590

    Sorry, it was supposed to be a link to a standard Editor example: http://live.datatables.net/wegowafu/1/edit . If you could get it running quill, we can see if there's a mistake in the config.

    Colin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @colin @kevin

    In the sample here you can set content of quill editor while editor is disabled

    As I see in the field type ext, enable and disable are described here as not supported...

    _fieldTypes.quill = {
    ....
        enable: function ( conf ) {}, // not supported by Quill
        disable: function ( conf ) {}, // not supported by Quill
    ....
    };
    

    So I change it to

    ....
        enable: function ( conf ) {
            conf._quill.enable();
        }, 
        disable: function ( conf ) {
            conf._quill.enable(false);
        }, 
    ....
    

    and work fine

    regards
    Bob

  • colincolin Posts: 15,179Questions: 1Answers: 2,590
    edited February 2021

    Ah thanks for that test case. It seems that the Quill API has improved since the integration - it now supports this in the code you pasted into the HTML tab:

        enable: function ( conf ) {conf._quill.enable()},
    
        disable: function ( conf ) {conf._quill.disable()},
    

    See here: http://live.datatables.net/dumabolu/2/edit

    Colin

  • colincolin Posts: 15,179Questions: 1Answers: 2,590

    p.s. I've updated the code so the next release will have this in the Quill plugin.

    Colin

This discussion has been closed.