Hello everyone,
I create a json object ,
{"devices":[{"name":"D9123","id":"32","isOn":"true","automation":{"suspended":"true","expiration":"15 January 20:00pm 2020"}},{"name":"D9043","id":"45","isOn":"true","automation":{"suspended":"false"}},{"name":"D4120","id":"29","isOn":"false","automation":{"suspended":"false"}}]}
and i am working on ajax i want to create a datable which has this elements but i cannot see objects in it.
This is my table:
Devices | Status | Automation |
---|
@section scripts
{
<script>
$(document).ready(function () {
$('#table').DataTable(
{
"ajax": {
"url": 'myurl',
"type": 'GET',
"datatype": 'json',
"dataSrc" : "data"
},
columns: [
{ "devices": 'name' },
{ "devices": 'isOn' },
{ "devices": 'automation.suspended' }
]
});
});
</script>
}
what is the problem please help me