FIX: eventos no se actualizaban con cambio de pagina en DataTables

This commit is contained in:
Juan Pablo Vial
2024-11-12 21:27:33 -03:00
parent 37c28c3080
commit e4ffcb52d8

View File

@ -162,13 +162,19 @@
}
},
data: this.props.movimientos,
rowCallback: (row, data) => {
$(row).find(this.props.ids.buttons.edit).on('click', {handler: this.props.eventHandler}, this.props.eventHandler.edit().movimiento)
$(row).find(this.props.ids.buttons.remove).on('click', {handler: this.props.eventHandler}, this.props.eventHandler.remove().movimiento)
}
})
this.props.table = new DataTable(this.props.ids.table, dtD)
}
draw() {
return {
table: (movimientos) => {
const info = this.props.table.page.info()
this.props.table.clear().rows.add(this.draw().movimientos(movimientos)).draw()
this.props.table.page(info.page).draw(false)
$(this.props.ids.buttons.edit).on('click', {handler: this.props.eventHandler}, this.props.eventHandler.edit().movimiento)
$(this.props.ids.buttons.remove).on('click', {handler: this.props.eventHandler}, this.props.eventHandler.remove().movimiento)
},