How do I get data dynamically generated data from server and feed into datatable?
How do I get data dynamically generated data from server and feed into datatable?
Hello everyone!
I am a newbie to datatables and want some one to pioneer me through this task. I am working on a project where I collect logs from different servers and create the below format before sending it to the client side..
Format of logs at server side:
{ "id" => [
{
"time_stamp" => "some_time",
"some_id" => "12345",
"url" => "some_url"
},
{
"time_stamp" => "some_time",
"some_id" => "12345",
"url" => "some_url"
}
]
}
I store all the collected logs in this format into a variable and convert it to json then send it to the client side. At the client side this json object is parsed and looped to feed the datatable with the data for analysis.
PS I am using ruby at the server side and not using any DB.
I wanted to know if I can get this data from server side in chunks. so that the datatable has some immediate data and new data keep on adding afterwards.
Please suggest some ways! Thanks in advance.
Leave comments if I am unclear about what I need..
Answers
This is how I am currently handling the data at the front end.
Here 'text' is the JSON data in above format from the server.
Please tell me if I am handling the data in the right way to feed into the datatable. Suggest a better and efficient way, if any.
Thanks
okay I finally found the way to do that effectively: