how to add a row dramatically on a button click event from a modal form

how to add a row dramatically on a button click event from a modal form

chino1.50chino1.50 Posts: 4Questions: 1Answers: 0

hi, everyone, I'm very new to datatables and need help I'm trying to add a new row to a datatable using a modal form it adds a blank row and in the type column witch is populate with a select html object I get thie [object HTMLSelectElement]

this is the code

($(document).ready(function(){
var parttb = $('#tbparts').DataTable();
var partnum = $('#partnumber').val();
var partdescr = $('#partname').val();
var parttype = $('#partty').val();
var partqty = $('#Quantity').val();
var partprice = $('#Price').val();

    $('#add').on('click', function(){
        parttb.row.add( [
                partnum,
                partdescr,
                partty,
                partqty,
                partprice
              ]).draw(false);
    });


});)

Answers

This discussion has been closed.