Monday 15 March 2010

javascript - DataTables.Net - Is there a way to set a property from the data? -



javascript - DataTables.Net - Is there a way to set a property from the data? -

what i'd set "column" property ajax data

the json info has "data" , "columns" property, pull info i'd have this.

primarytable = $('#example').datatable({ "ajax": "data.txt" });

lets txt file has column property define column {"data":"name"} etc, there way can reference it?

primarytable = $('#example').datatable({ "ajax": "data.txt" "columns" : data.columns });

is there way reference it? other way utilize jquery.ajax or getjson, i've played around , couldnt figure out how info load correctly.

thanks

it seems (at to the lowest degree of nov 2013), not possible done using single ajax call. source

the reply no - i'm sorry cannot in datatables @ time. total range of options available in aocolumns cannot represented in json (specifically functions) there no method in datatables @ time. might relax in future, @ moment you'll need create ajax request column info yourself. allan

you solve issue issuing 2 consecutive ajax calls: first fetching info populate table header columns, , sec - info itself.

the link provides sample phone call well.

javascript jquery ajax datatables

No comments:

Post a Comment