How to get input value inside datatable with paging set true

How to get input value inside datatable with paging set true

fr62190fr62190 Posts: 1Questions: 1Answers: 0
edited January 2023 in Free community support

I have input type number inside datatable and i have to use paging true because i have -+ 500 record. i use this code to get input value, but only get the current page not all page.

let detail = [];
$.each($datatable.rows().data(), function (i, row) {
    detail.push({
        entity_code: $entityCode.val(),
        branch_code: $branchCode.val(),
        subbranch_code: row[0],
        code: row[1],
        stock: $(`tbody input.stock:eq(${i})`).val()
    });
});

and this how i draw the table:

$.each(res.results, function (i, val) {
    $datatable.row.add([
        val.subbranch_code,
        val.code,
        val.name,
        `<input type="number" class="form-control form-control-sm stock" value="${val.stock}">`
    ])
});

$datatable.draw()

is there any way how i get all data from all page?

Answers

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

    This thread should help, it's asking the same thing.

    Cheers,

    Colin

Sign In or Register to comment.