sir i am binding my jquery datatable from database.i am getting data in my json object oldDataset variable like
var oldDataset= [
{"aptid":1,"businesname":"skulink","ownrnm":"rajiv"},
{"aptid":2,"businesname":"prodegios","ownrnm":"sanjeev"}
]
but it's not binding in my grid but when i pass static dataset of an array like this format then it binds the table.
var newstring=[
["1","skulink","rajiv"],
["2","prodegios","sanjeev"]
]
so how do i convert my oldDataset like newstring
What I have tried:
$(document).ready(function () {
$.ajax({
type: "POST",
url: "userControls/Wsc_comn.asmx/bindapttable",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
var data = msg.d;
$('#example').DataTable({
data: data,
columns: [
{ title: "aptid" },
{ title: "businesname" },
{ title: "ownrnm" }
]
});
}
});
});
<pre><table id="example" class="display" width="100%"></table>
my refrence site is :
DataTables example - Javascript sourced data[
^]