After adding new rows in a table when I focus on date it shows the date picker, but when I choose date it changes the date in first row of the table. How can I overcome this problem?
- First Date Before Adding New Row
- Second Row Date Before Date Picking
- Third After date Select, it Change the First One Not the Row I want to change
I'm trying these things. I've also changed 'body'->document
.
let datepickeropt = {
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
showAnim: 'slideDown',
duration: 'fast',
yearRange: new Date().getFullYear() + ':' + new Date().getFullYear(),
}
$('body').each(function(i, element) {
$(this).on('focus', '.date_pick', function() {
$(this).datepicker(datepickeropt);
});
});