I'm having trouble getting the footable V3 ajax data loading to work. I'm currently using v3.0.1 and trying to implement the example exactly as specified here:
http://fooplugins.github.io/FooTable/docs/examples/advanced/ajax.html
I have created the specified files columns.json and rows.json containing the same data provided in the example.
I'm initializing the table using:
$('.table').footable(
{
"columns": $.get("locatorApp/columns.json"),
"rows": $.get("locatorApp/rows.json")
});
I'm getting the error:
FooTable: unhandled error thrown during initialization. Error: No columns supplied. at Error (native) at ../footable-standalone-v3.0.1/js/footable.js:2623:16) at ../footable-standalone-v3.0.1/js/footable.js:2662:7)
I know it's finding the files OK as I can induce 404 errors by using incorrect filenames. I tried taking the data from the file and specifying it within the footable initialization object and it works without any problems.
$('.table').footable({
"columns": [{"name":"col1", "title": "Col 1"},
{"name":"col2", "title": "Col 2"} ],
"rows": [{"col1":"abc", "col2":"def"},
{"col1":"ghi", "col2":"jkl"},
{"col1":"ghi", "col2":"jkl"},
{"col1":"ghi", "col2":"jkl"},
{"col1":"ghi", "col2":"jkl"}]
});
I'm wondering if I'm not specifying the promises correctly, although they are identical as shown in the above footable example.
Any help is greatly appreciated.