Multi header grid - pk on cell?

Multi header grid - pk on cell?

jorgelaranjojorgelaranjo Posts: 5Questions: 2Answers: 0

I have the following JSON being sent to Datatables Editor

{
  "data": [
    { 
      "description": "ROW1 HEADER", 
      "flows": [
        {
          "amount": "10", 
          "pk": "pk1"
        }, 
        {
          "amount": "11", 
          "pk": "pk2"
      }, 
    {
      "description": "ROW2 HEADER", 
      "flows": [
        {
          "amount": "10", 
          "pk": "pk3"
        }, 
        {
          "amount": "11", 
          "pk": "pk4"
        }
]
}

I can get the amount to the table using:

columns: [
                {data: 'DT_RowId'},
                {data: 'description'},
                {data: 'flows.0.amount'},
                {data: 'flows.1.amount'},

However with the inline editor I get the, after editing to amount 100:

data[12][flows][0][amount]: 100
action: edit

I can parse the data[12]... but I'd like to get the primary key of this cell as it would make the update a lot easier.

Is it possible?
Backend is in Python/Flask

Answers

Sign In or Register to comment.