different fields editable on create than on edit

different fields editable on create than on edit

erwinricharderwinrichard Posts: 16Questions: 5Answers: 0

In my table I have several fields that may be set on create but may not be altered in an existing row.
What's the best way to make the popup editor show some fields only on create?

Thanks
Erwin

This question has an accepted answers - jump to answer

Answers

  • Rob BrunRob Brun Posts: 56Questions: 2Answers: 14
    edited July 2017 Answer ✓

    Hi erwinrichard, maybe like this.

      editor.on('initEdit', function () {
         editor.field('YourField').disable();
    }
    

    this will disable those fields not disappear them.
    to hide them I think you would do this

    editor.on('initEdit', function () {
          editor.hide('YourField');
    }
    
    

    Shay

  • erwinricharderwinrichard Posts: 16Questions: 5Answers: 0

    Thanks Shay,

    I'm obviously quite new to datatables, but you pointed me to the right docs.

    Regards
    Erwin

This discussion has been closed.