lo que prentedo hacer es cargar select de datatables usando algo como
Código PHP:
ipOpts:getStateList()
function getStateList() {
var aStateList = new Array();
aStateList[0] = { "label": "Type1", "value": "1" };
aStateList[1] = { "label": "Type2", "value": "2" };
aStateList[2] = { "label": "Type3", "value": "3" };
aStateList[3] = { "label": "Type4", "value": "4" };
return aStateList;
Código PHP:
[{"value":"1","label":"xyz"}, {"value":"2","label":"abc"}]
Código PHP:
function loader(){
test.splice(0,1);
$.ajax({
"url": "json2.json",
"async": false,
"dataType": 'json',
"success": function (json) {
for(var a=0;a < json.length;a++){
obj= { "label" : json[a][0], "value" : json[a][1]};
test.push(obj);
}
}
});
return test;
}