Disable inline editing

Disable inline editing

sozinsozin Posts: 5Questions: 2Answers: 0

Hi! I have a question about inline editing. I have page with inline editing working; it works great. I'd like to disable editing based on user action (basically the user can lock/unlock the page the page to disable/enable editing). Is there a way to do this? All of the examples out there only show how to enable inline editing, and not how to disable it after its been enabled.

cheers!

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Hi,

    Inline editing is activated by calling the inline() method - in most of the examples this is done with a click event listener - for example:

        $('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {
            editor.inline( this );
        } );
    

    If you no longer want that event listener, you would simply unbind it using jQuery event methods - $().off() in this case:

    $('#example').off( 'click', 'tbody td:not(:first-child)' );
    

    You could use an event namespace to ensure you don't remove other events that you do want to keep. See the jQuery event documentation for more information.

    Allan

  • sozinsozin Posts: 5Questions: 2Answers: 0

    perfect, ty!

This discussion has been closed.