You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project with datatable, which has one cell using customized render function. When I apply edit to this cell, the cell value can not be updated correctly.
I tried to add one callback function in case of update cell value and modified _update function as following:
function _update(newValue) {
var oldValue = cell.data();
var updateCallback = settings.inputTypes.filter(item=>item.column === columnIndex)[0].updateCallback;
if (updateCallback) {
// console.log('updatecallback')
updateCallback(cell, row, newValue);
cell.data(null);
} else {
// console.log('no updatecallback')
cell.data(newValue);
}
settings.onUpdate(cell, row, oldValue);
}
I am working on a project with datatable, which has one cell using customized render function. When I apply edit to this cell, the cell value can not be updated correctly.
I tried to add one callback function in case of update cell value and modified _update function as following:
as add one option to inputTypes option
{ "column": 14, "type": "list", // requires jQuery UI: http://http://jqueryui.com/download/ "options": target_remark_types, "updateCallback": function (cell, row, newValue) { row.data().remark_type_id = parseInt(newValue); row.data().remark_type = target_remark_types.filter(target_remark=>target_remark.value === newValue)[0].display } }
so far it works well for me. But not sure if any side effects which I do not notice.
The text was updated successfully, but these errors were encountered: