This topic contains 7 replies, has 4 voices, and was last updated by  wcizmowski 2 days, 6 hours ago.

Data table / Row details


  • wcizmowski
    Participant

    Posts: 6
    Member Reply #16810

    Hi,

    I need to implement this Data table.

    Info inside Metroinic : “The Metronic Datatable component supports local or remote data source. For remote data you can specify a remote data source that returns data in JSON/JSONP format. In this example the grid fetches its data from a remote JSON file”

    But… I have a database, not a JSON file. So, I can convert my data or generate JSON if it is neccessary.

     

    Please tell me about posibilities. It is possible to load data from database ? Or I must have JSON ?

    Here is screenshot from Metronic, this table I need: http://nimb.ws/vh8Mlx

    • This topic was modified 3 days, 21 hours ago by  wcizmowski.
    • This topic was modified 3 days, 21 hours ago by  wcizmowski.
    guntar
    guntar
    Participant

    Posts: 22
    Member Reply #16816
    This reply has been marked as private.

    ramon9585w
    Participant

    Posts: 5
    Member Reply #16833

    I am trying to implement exactly the same datatable (with row details).

    Could I get access to the above reply, maybe it might help me.

    guntar
    guntar
    Participant

    Posts: 22
    Member Reply #16848

    Hi , sory ,

    Maybe you can find in this link ,

    mDatatable Initialization

    You just convert object  data to format json_encode via ajax call.

    ie (in php use echo json_encode($data))

    • This reply was modified 2 days, 21 hours ago by guntar guntar.

    wcizmowski
    Participant

    Posts: 6
    Member Reply #16850

    This reply is private. Can I show ?

    Jai
    Jai
    Keymaster

    Posts: 1786
    Support Staff Reply #16874

    Hi 🙂

    Regarding your question about;

    Please tell me about posibilities. It is possible to load data from database ? Or I must have JSON ?

    You can use remote ajax datasource, from your own custom backend to serve the json data from your database.

    You can check our example backend script, which written in PHP;

    docs/api_reference/datatables/demos/default.php

    Thanks


    ramon9585w
    Participant

    Posts: 5
    Member Reply #16882

    Yes I know, I am using the web2py framework as back-end so it is working a little bit different.

    But basically I got an API call which returns data in this format:

    {
    “data”: [
    {
    “some_key1″:”some_value1”,
    “some_key2″:”some_value2”,
    “some_key3″:”some_value3”,|
    “some_key4″:”some_value4”,
    },
    {
    “some_key1″:”some_value1”,
    “some_key2″:”some_value2”,
    “some_key3″:”some_value3”,|
    “some_key4″:”some_value4”,
    },
    { …. } , …
    ]
    }

     

    The table itself renders fine, just when I try to implement row details it ain’t working, I already looked into the Metronic Datatable API quite a bit but I can’t figure it out. I mean when I use autothide: !0 it shows the details arrow but it doesn’t show details when I click on it.

    • This reply was modified 2 days, 7 hours ago by  ramon9585w.

    wcizmowski
    Participant

    Posts: 6
    Member Reply #16884

    Hi,

    Thanks for code example, but it is for me 50% because

    I don’t see inside Metronic pages/code place with read data from JSSON.

     

    Finally:

    1. I have data from DB converted into JSON

    2. I need expamle how to load into table.

     

    THANKS IN ADVANCE.

Tagged: 

You must be logged in to reply to this topic.