Remove Update button on Editor - ReadOnly Editor View

Remove Update button on Editor - ReadOnly Editor View

dp@ii.netdp@ii.net Posts: 38Questions: 10Answers: 0

I'm creating an Editor instance that is read-only. I disable each field via a call to

<code>
editor.on( 'open', function () {

    editor.disable( 'field1' );
    editor.disable( 'field2' );

   } );

</code>

and then a call to put in an extra button to close Editor

<code>

TableTools.BUTTONS.editor_edit.formButtons.push({ "label": "Close", "fn": function (e) { this.close(); } });

</code>

But how can I remove the Update button ?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Answer ✓

    Hi,

    Rather than using formButtons.push - you could just replace the array with that of your how choice - probably best doing it the button definition with sExtends rather than setting a default though. In aButtons:

    {
      sExtends: 'editor_edit',
      editor: ...,
      formButtons: [
        { "label": "Close", "fn": function (e) { this.close(); } }
      ]
    }
    

    Regards,
    Allan

  • dp@ii.netdp@ii.net Posts: 38Questions: 10Answers: 0

    Perfect.

    Explains why I couldn't work out how to do it with calls to .push et. al.

  • dp@ii.netdp@ii.net Posts: 38Questions: 10Answers: 0
    edited July 2015

    Some more crumbs for those coming later ;

        "tableTools": {
            "aButtons": [
    
    ...
    
    
            {
                "sExtends": "editor_create",
                "editor": labeleditor,
                "sButtonText": "Print Valve Labels",
                "formButtons": [
                    { "label": "Cancel", "fn": function (e) { this.close(); } },
                    { "label": "Print Labels", "fn": function (e) { this.submit(); } }
                ]
            },
    
    ...
    
    
    
This discussion has been closed.