parse json ajax
parse json ajax

hi i have a simple table
<table id="tablefiles">
<thead>
<tr>
<th> id </th>
<th> File </th>
<th> type </th>
<th> Modified Time </th>
<th> size </th>
</tr>
</thead>
<tbody>
</tbody>
</table>
i want:
1-create definition of colum in datatable
2-call my rest and parse the success before Datatable insert data in store.
my json schema :
{
"files": [
{
"id": 1,
"uri": ".idea",
"filename": ".idea",
"directory": true,
"attributes": {
"lastModifiedTime": "2016-04-22T14:50:56Z",
"isDirectory": true,
"size": 4096
}
},
{
"id": 2,
"uri": ".svn",
"filename": ".svn",
"directory": true,
"attributes": {
"lastModifiedTime": "2016-04-22T14:50:56Z",
"isDirectory": true,
"size": 4096
}
}
]
}
i must use only some property in my schema json.
it's possibile???
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
It sounds like you want to make the Ajax call yourself (use
$.ajax
for example) and then add the rows to the table usingrows.add()
.Allan