inline row editing, returned server data

inline row editing, returned server data

stephendwolffstephendwolff Posts: 5Questions: 1Answers: 0

Hi there, is there an option for inline editing to update the editor row data with the returned data from the server after an inline edit, i've tried the options on this page: https://editor.datatables.net/examples/inline-editing/submitData.html, but they are all for data being submitted to the server, rather than acting on data returned from the server.

My interface isn't updating with data returned. The documentation says "which can be useful if you need to perform calculations on the server-side based on information in the row, regardless of which field value was altered." I need to update other fields in the row based on changes in one field. Should i be doing this before submitting the data on the client side, and updating the client table and submitting all changes?

Thanks,

Stephen

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Yep, that should happen. One possible cause would be if the returned data isn't in the correct format. In the example you linked to, if you look at the Ajax data you'll see the response.

    If that doesn't help, are you able to link to your page so we can take a look.

    Colin

  • stephendwolffstephendwolff Posts: 5Questions: 1Answers: 0

    Hi there, that does help, but now it seems to be triggering a full table load after the valid data returns. I didn't have the dictionary with the 'data' key - and was just returning the row before.

  • stephendwolffstephendwolff Posts: 5Questions: 1Answers: 0

    Yes, the editor ajax call (which returns data in the expected format) is now triggering the table ajax 'load' (where it wasn't before).

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    edited April 2020 Answer ✓

    Do you have serverSide enabled? If so, the new row may affect the paging due to the ordering, so that would require a load of the rows on that page.

    If not, are you able to link to your page so we can take a look. If not, please could you post your table config please, and also the response from the server.

    Colin

  • stephendwolffstephendwolff Posts: 5Questions: 1Answers: 0

    I do have the server side option, but it’s a 100 row table, without pagination. I’ll try without and see if that works for me. Thanks for your help

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    Yeah, that would cause it - as the current page would be reloaded (which for you is everything).

    You only need serverSide if you have 10ks of rows, otherwise client-side would be fine.

    Colin

  • stephendwolffstephendwolff Posts: 5Questions: 1Answers: 0

    Ok - that worked. I think i misunderstood what the serverSide option did, so thanks for clarifying.

This discussion has been closed.