disable( [ fieldName ] ) posting data regardless

disable( [ fieldName ] ) posting data regardless

chopstikchopstik Posts: 14Questions: 5Answers: 0

I've a multi-row editor with the following checkbox (+ other fields)...
fields: [{name: 'InvoiceOutbound.approval', label:'Approval', type:'checkbox', options: {'': 1}}]

Within the initEdit Editor event I need to disable that editor field depending on circumstance...
editor.disable(['InvoiceOutbound.approval']);

On a multi-row edit action the server is receiving the data as if the fields had not been disabled as would have happened in a normal HTTP form post. Within the editing form itself the fields are disabled to the User as expected, but the Ajax post of data (assumed to be disabled) causes issues as the field is included in the post and means further processing at Server. Is this anticipated behaviour?

action:edit
data[1][InvoiceOutbound][approval][]:1
data[2][InvoiceOutbound][approval][]:1

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    This is correct - the disable() method reflects the end user's ability to modify the field. The field still exists and it can still have its value modified via the API - it is the user's interaction that it disables.

    Allan

  • chopstikchopstik Posts: 14Questions: 5Answers: 0

    Cheers Allan, appreciated.

This discussion has been closed.