Don't user aaData
Don't user aaData
Hi all,
I have this class:
[code]
function Clazz() {
this.id;
this.description;
}
Clazz.prototype._findAll = function(_callback) {
$.ajax({
type : "GET",
url : "api/route",
dataType : "json",
success : function(data) {
_callback(data);
}
});
};
[/code]
I want to load a datatable, so I do this way:
[code]
function loadTable(data){
// Here a I want to load my datatable
}
$(function(){
var clazz = new Clazz();
clazz._findAll(loadTable);
});
[/code]
How can I load the datatable if the data is an array of object like this:
[code][{"id":1,"description":"Test 1"},{"id":2,"description":"Test 2"}][/code]
Thanks,
Luciano
I have this class:
[code]
function Clazz() {
this.id;
this.description;
}
Clazz.prototype._findAll = function(_callback) {
$.ajax({
type : "GET",
url : "api/route",
dataType : "json",
success : function(data) {
_callback(data);
}
});
};
[/code]
I want to load a datatable, so I do this way:
[code]
function loadTable(data){
// Here a I want to load my datatable
}
$(function(){
var clazz = new Clazz();
clazz._findAll(loadTable);
});
[/code]
How can I load the datatable if the data is an array of object like this:
[code][{"id":1,"description":"Test 1"},{"id":2,"description":"Test 2"}][/code]
Thanks,
Luciano
This discussion has been closed.
Replies
Allan