FORM EDITOR WITH DISPLAY VIEW MODE !

FORM EDITOR WITH DISPLAY VIEW MODE !

lauromnetolauromneto Posts: 129Questions: 0Answers: 0

Good Morning. I have a create button, an edit button and I created a detail button. in this detail button I need the form fields to be readonly.
I created a new editor like editor_display, but I can't use the same custom class as the form create, so I would have to create several forms in html, several css for them, unviable!
What is the simplest solution for this, since it would be a framwork option that does not exist and I think it should exist?

Replies

  • lauromnetolauromneto Posts: 129Questions: 0Answers: 0

    Nobody to help here?

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    I created a new editor like editor_display,

    Is that Editor? Or something like Editor?

    Colin

  • lauromnetolauromneto Posts: 129Questions: 0Answers: 0
    edited June 2020

    For those who want it, working 100%
    It is necessary to put on ('close') the enable, because otherwise when you open some other editor mode, even if it is for some button in rows in the table, it will continue to disable!

    And you don't need to create a new editor .... you can use 1 only 1 editor and with a single class, if you want to work with custom form

    buttons:[{
        extend: "selected",
        text: "Detalhar",
        className: 'btn btn-secondary buttons-selected buttons-edit btn-blue',
        action: function ( e, dt, node, config ) 
        {
            editor.edit( table.row( { selected: true } ).index(), true );
            editor.disable();
            e.preventDefault();
            editor.edit( $(this).closest('tr'), {
                title: 'Detalhe do Registro',
                buttons: [{text: 'Fechar', action: function () { this.close(); } }],
            } );
        }
    }]
    
    editor.on( 'close', function ( e, type ) {
        editor.enable();
    } );
    

    Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This discussion has been closed.