Let the editor create the form based on Ajax

Let the editor create the form based on Ajax

OlivierOlmerOlivierOlmer Posts: 3Questions: 1Answers: 0

Hello,

I have a datatable and within this table only a small part of my data is shown. To preserve bandwith I only send the data that should be shown in the datatable.
When I edit however it should fetch more data about that certain row from the server first, before building the form.
Is this somehow possible?

Example:
The data for the datatable:

{
"data":[
{
"testColumn1": "a",
"testColumn2": "a",
"testColumn3": "a"
}
]
}

The data when editing:

{
"data":[
{
"testColumn1": "a",
"testColumn2": "a",
"testColumn3": "a",
"testColumn4": "a",
"testColumn5": "a",
"testColumn6": "a",
"testColumn7": "a",
"testColumn8": "a",
"testColumn9": "a"
}
]
}

This question has an accepted answers - jump to answer

Answers

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

    There isn't any built in option for this.

    However, you could possibly trigger you Ajax data fetch, then use row().data() to update the row's data in the DataTable and only then start the edit (since the full data is then available).

    That is the only way I can think of at the moment for this case.

    Allan

  • OlivierOlmerOlivierOlmer Posts: 3Questions: 1Answers: 0

    Thanks, that should do it :D

This discussion has been closed.