ejbeaty/CellEdit

No callback function if cell use customized render()

Opened this issue · 0 comments

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);
            } 

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.