send aditional data from the server

send aditional data from the server

MarioZan.ClMarioZan.Cl Posts: 2Questions: 2Answers: 0

Hello Friends, I'm displaying a datatable with information from a mysql table. I need to send back an aditional value taken from the same table, but i dont have to display this value in the datatable colums.
Since ajax retrun the columns that have to be displayed I dont know how to include a variable with a value that i need not for displaying in the datatable.
Any Idea?
Thanks a lot

Answers

  • colincolin Posts: 15,236Questions: 1Answers: 2,598

    Hi @MarioZan.Cl ,

    DataTables only uses the part of the Ajax data pointed to in the ajax.dataSrc property - this example here shows how it can be modified and set to anything in the Json data. So, you can still set your variables anywhere in the returned data, provided it's not under that dataSrc. ajax.json() will give you all the data last returned by the server, so your data is easy to retrieve.

    Hope that helps,

    Cheers,

    Colin

This discussion has been closed.