Table as a "matrix"

Table as a "matrix"

malinovskimalinovski Posts: 10Questions: 2Answers: 0

hi all,
i have a database table with this kind of records:
A | B | C fields with A containing a name, B a date and C a value;

I need to show the names in A as a kind of header (each name once, and starting from second column) and then dates in B as first column, such data for each date i have the values of C for each A

I hope i've been clear enough, how can i achieve that?

i leave a pic as example
thank you

Answers

  • colincolin Posts: 15,236Questions: 1Answers: 2,597

    Hi @mailinovski ,

    You would need to pre-parse the data first. You can run an ajax query first, manipulate the data into the format you present above, then pass that into data during the table initialisation.

    Cheers,

    Colin

  • malinovskimalinovski Posts: 10Questions: 2Answers: 0

    thanks @colin , i am quite new to datatables, can you give me some other "hints" to start?
    thanks

  • colincolin Posts: 15,236Questions: 1Answers: 2,597

    Hi @malinovski ,

    This example may help. It's showing how you can initiate an Ajax call, then feed that into DataTables - for you, you would need to do that manipulation prior to the load.

    Cheers,

    Colin

  • malinovskimalinovski Posts: 10Questions: 2Answers: 0

    but, in case i need to do serverside processing, how does the scenario change?

  • colincolin Posts: 15,236Questions: 1Answers: 2,597

    Then the server would need to send back the data in the expected format.

  • malinovskimalinovski Posts: 10Questions: 2Answers: 0

    wait... i'm really a very a beginner... whats the exact order of steps concerning
    ajax call, arraning data, serverside processing and other (if i am missing something else) ?

This discussion has been closed.