Edit response format

Edit response format

tiebreaktechtiebreaktech Posts: 20Questions: 3Answers: 1

hello,

i'm using select inputs in my table. one in particular is in the format

{ data: "player.label", editField: "player.value" }.

the editor entry for that parameter is

{ label: 'Giocatore', name: "player.value", type: "select", options: people }.

After i update the row i get this warnin :

Requested unknown parameter 'player.label' for row 1

is it something wrong with the format? i return an array of the exact format of the one that i use to populate the table

Answers

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

    Hi,

    The error suggests that the Ajax response from the server doesn't contain the full information for the row (specifically the player object with a label property).

    What is the JSON that is being returned from the edit request?

    Allan

  • tiebreaktechtiebreaktech Posts: 20Questions: 3Answers: 1
    edited July 2016
    {
        "data": [{
            "id": "1695",
            "hteam_id": "18",
            "vteam_id": "19",
            "time": "12:39:12",
            "set_number": "1",
            "player": {
                "label": "2-Schiacciatore",
                "value": "181"
            },
            "player_id": "181",
            "homescore": "7",
            "visitorscore": "9",
            "skill": {
                "label": "Attacco",
                "value": "1"
            },
            "mark": {
                "label": "#",
                "value": "1"
            },
            "type": {
                "label": "",
                "value": null
            },
            "pos": "3",
            "setter_pos": "1",
            "opp_setter_pos": "1",
            "disp_name": {
                "label": "Unendo yamamay Busto Arsizio",
                "value": "19"
            },
            "team_id": "19",
            "DT_RowId": "1695",
            "hs": "7",
            "vs": "9"
        }]
    }
    

    (sorry, i don't know how to format it)

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

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

    Interesting - that looks completely correct.

    Could you give me a link to your page so I can debug what is going wrong please?

    Thanks,
    Allan

  • tiebreaktechtiebreaktech Posts: 20Questions: 3Answers: 1

    sadly it requires authentication.

    any hint about what should i search for in the debugger?

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

    After the warning comes up try running the DataTables debugger and let me know:

    1. What the debug code is
    2. What the row id that was edited was

    The error you are seeing means some data is missing from the return - but from what you've posted above it does appear to be present.

    Allan

  • tiebreaktechtiebreaktech Posts: 20Questions: 3Answers: 1

    by updating the library the warning disappeared but the row now does not update.

    anyway the main problem is solve. i can reload the table.

This discussion has been closed.