How hide 'recordId' column while edit.But same column need to show while create in datatables editor

How hide 'recordId' column while edit.But same column need to show while create in datatables editor

OmniwyseOmniwyse Posts: 29Questions: 11Answers: 0
edited March 2023 in Free community support

My table contains 3 columns.

one of the column that is recordId is should hide while editing a row.Same column should be show while creating new one.

I am using datatables editor.

fields: [{
        label: "recordId :",
        name: "recordId ",
        data: recordId,
    },
    {
        label: "Name :",
        name: "name",
        data: "name",
    }, {
        label: "Description :",
        name: "description",
        data: "description"
    }
]

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

Answers

  • allanallan Posts: 62,084Questions: 1Answers: 10,179 Site admin

    Use the initCreate and initEdit events - e.g.:

    editor
      .on('initCreate', () => editor.show('recordId'))
      .on('initEdit', () => editor.hide('recordId'));
    

    Not sure if it was a typo in the post, or actually in your code, but the name parameter for recordId has a trailing space there.

    Allan

  • OmniwyseOmniwyse Posts: 29Questions: 11Answers: 0

    Thanks allan.. :)

Sign In or Register to comment.