parse json ajax

parse json ajax

lbottonilbottoni Posts: 5Questions: 4Answers: 0
edited May 2016 in Free community support

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.

Answers

  • allanallan Posts: 64,798Questions: 1Answers: 10,728 Site admin

    It sounds like you want to make the Ajax call yourself (use $.ajax for example) and then add the rows to the table using rows.add().

    Allan

This discussion has been closed.