bind array to datatable where first row is columns description

bind array to datatable where first row is columns description

marco.rudello@gmail.commarco.rudello@gmail.com Posts: 12Questions: 4Answers: 0

Hi,
am Marco from Italy
I try to use your grid. I want to bind a bidimensional array where the first row is columns name. How to do?
thank

Answers

  • marco.rudello@gmail.commarco.rudello@gmail.com Posts: 12Questions: 4Answers: 0

    I try with this:
    $("#grdScarti").dataTable({
    data: arRow,
    columns: function () {
    for (x = 0; x < arcol.length; x++) {
    title: arcol[x]
    }
    }
    });

    but doesn't run

  • Tom (DataTables)Tom (DataTables) Posts: 139Questions: 0Answers: 26

    Datatables will not automatically listen to values in a source array.

    You would have to call the row().invalidate() to have Datatables read from the data source again.

    Thanks

    Tom

  • marco.rudello@gmail.commarco.rudello@gmail.com Posts: 12Questions: 4Answers: 0

    Hi Tom,
    thanks for your response but my English is not good: I want only display content of my array with your grid no change or insert are request only display.
    I try with this:
    $("#grdScarti").dataTable({
    data: arRow,
    columns: function () {
    for (x = 0; x < arcol.length; x++) {
    title: arcol[x]
    }
    }
    });
    I don't know how many columns are in my array, its fill dynamically.
    Thanks
    Marco

This discussion has been closed.