How to modify the data object that is sent to the server on edit.

How to modify the data object that is sent to the server on edit.

IsaacBenIsaacBen Posts: 35Questions: 8Answers: 4
edited January 2017 in Free community support

Currently the format is

data.idSrcValue.columnName

This is a bit not friendly for my backend. I would like it to just be

columnName: value

I'm doing this dirty hack for now. Would like to know if there is a better way.

data: function ( d ) {
    var id = Object.keys(d.data)[0];
    var columnName = Object.keys(d.data[id])[0];
    d[columnName] = d.data[id][columnName];
    return d;
},

I have no idea how to get the column name and idSrc of the edited row so had to pull them out with Object.keys.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,836Questions: 1Answers: 10,518 Site admin
    Answer ✓

    Hi,

    There is a discussion about this here which you might find interesting.

    Allan

This discussion has been closed.