Combining multiple fields for readonly title in the editor form
Combining multiple fields for readonly title in the editor form
Is it possible to combine fields in a readonly part of the editor form?
E.g. I wanted to display "first_name last_name (extn)" at the top of the form as read only values with the rest of the fields editable below.
I have seen how you can use the read only display plugin (https://editor.datatables.net/plug-ins/field-type/editor.display) with only one field but was wondering how to do something similar with mutliple fields?
This question has an accepted answers - jump to answer
Answers
Yes, you can use the
fields.data
method in much the same way as the DataTablescolumns.render
method to manipulate the data. Using it as a function you have access to the full data object for the row and thus can return whatever you want based on that data. The only slightly more complicated factor withfields.data
is you need to handle theset
case, but if it is readonly you could simply doif ( type === 'set' ) { return; }
.Allan
Thank You Allan - that's perfect :-)