Select on change event disappear after tr modification

22 views Asked by At

I have list of rows and one cell with select. One row is hidden. I use it as a form to add new row. On document ready I select all select fields and add on change event for all of them:

const supplierFields = $('select[name$="supplier"]');
supplierFields.on('change', async (select) => {
        //custom logic here..
    });

When I use hidden row to add new row I select it and add data:

const emptyForm = EstimatesTable.visualization.formSet.find( '.empty-form').prev('tr');

When new row is added event on select field disappears, but other events on inputs for example stays. Where could be an issue? When I inspect elements on browser hidden row and other old rows has events. After refresh event appears because of on document ready function.

0

There are 0 answers