DataTables - Node JS - HEADER + Many rows

DataTables - Node JS - HEADER + Many rows

gnux8gnux8 Posts: 30Questions: 4Answers: 0

Good Morning,
I would like to use datatable for my project. The idea is to have many data table like lot, provider etc etc where i've make a control quality form.

I would like to have a header that will be an incremental number with other information about the lines etc etc and the many rows linked to the header number ...

looking into the examples i didn't found it ...

i see something similar related to the check box but nothing related to what i'm looking for,

thanks in advanced,

best regards,
Andrea

Answers

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,771
    edited September 2019

    Sounds like you want to build dynamic table header. You can use Datatables to build the thead with columns.title. However you need to build a variaible with the columns.title definitions before initializing Datatables. Here is an example:
    http://live.datatables.net/huyexejo/1/edit

    It derives the header names from the keys of the first object in the data. Instead of doing this you could return a data object that contains the columns names.

    Is this what you are looking for?

    Kevin

  • gnux8gnux8 Posts: 30Questions: 4Answers: 0

    Good Afternoon Kevin, first of all thanks for your precious support. I'll try to give a better view what i would like to achieve:

    Order:
    * IDOrder
    * OrderDate
    * IDProduct
    * Qty


    In my datatable I would like to have something like that:

    Date: 09/10/2019

    Order: 1

    ID DESCRIPTION QTY

    1 PEN 3

    3 PAPER 4

    4 CUTTER 1

    .... N

    In this case 1 order correspond N Products ...

    I would XX row when i needed once added will be display into the relative datatable

    Best Regards,
    Andrea

  • gnux8gnux8 Posts: 30Questions: 4Answers: 0

    Just an example about what i mean ... imagine that the user click on a row and insert to product

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,771

    Still not exactly clear on what you want. Maybe the Inline Editor is something you are looking for. Here is an example:
    https://editor.datatables.net/examples/inline-editing/simple.html

    You can build the Datatable around your order form example.

    Kevin

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Hi @gnux8 ,

    Do you mean something like this where the row has a counter?

    Cheers,

    Colin

This discussion has been closed.