How to set the dropdownlist value when using datatables.rows.add

How to set the dropdownlist value when using datatables.rows.add

darkshadow89darkshadow89 Posts: 1Questions: 1Answers: 0

Hi all,

i would like to set the dropdownlist value while i doing add row to my datatables.
Code as below

$.each(data, function () {
if ($('#itemdetails tr > td:contains(' + this["itemcode"] + ')').length == 0) {

                itemdetails.row.add([
                    null, // delete
                      this["itemcode"], // item code
                        this["itemname"],// item name 
                        1, // Quantity
                        0.00, // Price
                        this["vatgroup"], // tax code
                        this["vatprcnt"], // tax rate
                        null, // High Levels
                        null, // Low Levels
                        0.00, // LineTotal
                ]).draw(false);
            }
        });

the tax code is the dropdownlist control, quantity, price and linetotal is a textbox control.
I got no issue while setting value into textbox control.
But when i set value to the dropdownlist control, it got no effects.

Any idea?

Please assist me, thank you in advance

This discussion has been closed.