Must I have every field name identified on page?
Must I have every field name identified on page?
I have a server-side version working great. I'm now trying to build a Ajax version. I have a script that queries my data on my server, and generates (I validated it) good JSON. I do a CRON job to update the file nightly. The issue is I can't for the life of me get a single row of data (only 5k rows) to appear.
Do I have to rename the .json file as a .txt file is one question
The second question is do I have to account for every field in the JSON file? I have 75 columns but, am only wanting to display about 10 on the DataTable.
Thank you very much. Your product kicks butt and I can't wait to dig in deeper.
This question has an accepted answers - jump to answer
Answers
If you don't have the identical number of elements in the JSON file as you want to appear in the table, you should define the columns with a data name.
This sets up datatTables to populate the column with the named data
Its also worth pointing out that the extension of the file is irrelevant - as long as it contains valid JSON.
We'd need to know the JSON structure to help any more than that.
Allan
Thanks guys. I did get it to work by including every possible field available, even though I was only calling a few to display on the table. Love DataTables!