Don't show field in edit form but still send/edit data
Don't show field in edit form but still send/edit data
I have an inTable button to edit records. The field values are variables. How can I not show field03 in the edit form but still send/edit the record? I tried https://editor.datatables.net/reference/api/field().displayed() like this
editor.field( 'field03' ).displayed(false);
But that didn't work.
editor = new $.fn.dataTable.Editor( {
ajax: "editor.php",
table: "#mytable",
fields: [ {
label: "Field 01:",
name: "field01"
}, {
label: "Field 02:",
name: "field02"
}, {
label: "Field 03:",
name: "field03"
}
]
} );
var add_inTable = $('#mytable').on('click', 'a.button', function (e) {
...
editor
.disable( 'field01' )
.set( 'field01', var01 )
.set( 'field02', var02 )
.set( 'field03', var03 );
editor.field( 'field03' ).displayed(false);
} );
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Use the
hidden
field type.Allan
Ahh ... perfect, thanks! :-)