trying to select first two colums from table on select

trying to select first two colums from table on select

ggiavelliggiavelli Posts: 5Questions: 3Answers: 0
edited February 2019 in Free community support

So I am currently getting the first column's data which are selected from my datatable

let rows = table.rows( { selected: true } );
                var result =  table.cells( rows.nodes(), 0 ).data();
                delete result["context"];
                delete result["length"];
                delete result["selector"];
                delete result["ajax"];

But I'd like to get the first two columns of data in the table.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @ggiavelli ,

    You can just use rows().data() to get the entire row's data - so something like:

    let results = table.rows( { selected: true } ).data();
    

    Cheers,

    Colin

This discussion has been closed.