Data returned from API Update

Data returned from API Update

GarronGarron Posts: 2Questions: 1Answers: 0

I'm currently handling the data updates and inserts manually due to performance on some of the views and tables.

When I edit the record in the data table component its sends back the fields that have been edited, it does not send back any of the "lookup" table fields.

When I send back the data, with the rowid I'm only sending back what I receive in the suggested structure {"data":[{..},{..}]} etc. I however get an error back saying there are missing fields. Is there any option to send back just the RowId or changed data as confirmation that everything is Ok?

Thanks

This question has an accepted answers - jump to answer

Answers

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

    Currently no - I'm afraid that Editor expects the full row's data back. This is something I plan to relax for v1.8 (which should be available August/September).

    At the moment what you would need to do is use postSubmit to merge the data returned from the server with that from the DataTable. The new ids() method can be useful to get the ids of the row(s) submitted - then use rows().data() to get the data for those rows and merge them together ($.extend).

    Allan

  • GarronGarron Posts: 2Questions: 1Answers: 0

    Thanks Allan, worked a charm

This discussion has been closed.