Ajax question
Ajax question
So, say I have some code that looks like this:
[code]
$.ajax({
type: "POST",
url: ".../broker",
data:"_debug=0&_program=@sas_prog_prefix@get_ids_test.sas&_service=@sas_intrnet_service@&subject_id=" + $.trim($(this).find("#systemIDCell").text()),
dataType: "json",
success: function( data ){
$('#table_id').dataTable( {
"bProcessing": true,
"sAjaxSource": data.aaData,
"aoColumns": [
{"mDataProp": "id"},
{"mDataProp": "id_info_desc"}
]
});
});
}
});
[/code]
I'm trying to load the json result into dataTables without much success. Could someone help me a little? Do I have the initialization in the wrong spot? The data is being returned correctly, but I can't get it to display in the table.
[code]
$.ajax({
type: "POST",
url: ".../broker",
data:"_debug=0&_program=@sas_prog_prefix@get_ids_test.sas&_service=@sas_intrnet_service@&subject_id=" + $.trim($(this).find("#systemIDCell").text()),
dataType: "json",
success: function( data ){
$('#table_id').dataTable( {
"bProcessing": true,
"sAjaxSource": data.aaData,
"aoColumns": [
{"mDataProp": "id"},
{"mDataProp": "id_info_desc"}
]
});
});
}
});
[/code]
I'm trying to load the json result into dataTables without much success. Could someone help me a little? Do I have the initialization in the wrong spot? The data is being returned correctly, but I can't get it to display in the table.
This discussion has been closed.
Replies
Allan
[code]
{
"aaData": [
{"id":"3303925","id_info_desc":"ID 1"}
,
{"id":"12345678","id_info_desc":"ID 2"}
]
}
[/code]