Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

Problem while populating dataTable with a txt file.

$
0
0
Hi all,

I am working with dataTable and I am having some trouble to populating the dataTable from a txt file
I am still having the Loading message in the Table and nothing from my txt file in being displayed.

Here is the way I have tried to do:

$("#table").dataTable({
"bProcessing": true,
"sAjaxSource": "Sources/data.txt",
"aoColumns":[
{"mData":"first_name"},
{"mData":"second_name"},
{"mData":"address"},
{"mData":"birthday"}
],
"bJQueryUI":true,
"sPaginationType":"full_numbers"
});

and my data.txt file which is located to the Source folder looks like this:

[
{
"first_name": Test1,
"second_name": Test1,
"address": Test1,
"birthday": 21-09-2000
},
{
"first_name": Test2,
"second_name": Test2,
"address": Test3,
"birthday": 21-09-2000
},
{
"first_name": Test3,
"second_name": Test3,
"address": Test3,
"birthday": 21-09-2000
},
{
"first_name": Test4,
"second_name": Test4,
"address": Test4,
"birthday": 21-09-2000
}
]

How can I solve this problem?

Thanks!

Viewing all articles
Browse latest Browse all 1816

Latest Images

Trending Articles



Latest Images