In my jqxGrid
my columns format is custom.
When I click on cells if there is saved data on that cell grid is deleting it, when i click Esc
key on my keyboard the value comes back, when i click with mouse on some part of the grid table the value remains deleted.
I have tried to imitate the Esc key on mouse click but it does not worked
var columns = [
{
text: 'Անվանում',
dataField: 'device_name',
width: '15%',
editable: false,
pinned: true,
cellsrenderer: customRenderer
},
{
text: 'INDEX',
dataField: 'ind',
width: '15%',
editable: false,
columntype: 'default',
hidden: true
},
{
text: '',
dataField: 'saveRow',
columntype: 'button',
align: 'center',
width: 100,
cellsalign: 'center',
pinned: true,
cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {
let device_name = $('#jqxgridDevice').jqxGrid('getcellvalue', row, 'device_name');
let sub_ind = $('#jqxgridDevice').jqxGrid('getcellvalue', row, 'sub_ind');
if (device_name != 'ժամ / րոպե' && sub_ind != 0) {
return "Պահպանել";
} else {
return ' ';
}
},
'SPN-CPAP (Ինտուբացիոն խողովակ)', 'SPN-CPAP (Տրախեոստոմիկ խողովակ)', 'SPN-CPAP (NIV ոչ ինվազիվ դիմակ)']
if (breathingTubes.includes(device_name)) {
var selectBox = $('<select name="type" style="width: 56px; heigh: 21px"><option value="">'+ "" +'</option><option value="ԻԽ">'+ "Ինտուբացիոն խողովակ" +'</option><option value="ՏԽ">'+ "Տրախեոստոմիկ խողովակ" +'</option><option value="NIV">'+ "NIV ոչ ինվազիվ դիմակ" +'</option></select>');
$(editor).append(selectBox);
selectBox.focus()
// Handle editor value changes
selectBox.on('change', function () {
// Update the editor value to synchronize with the input
editor.val(selectBox.val());
});
} else {
// Create a jqxInput (textbox) editor
var inputElement = $('<input type="number" class="jqx-widget jqx-input jqx-rc-all" style="width: 35px; height: 21px;" />');
$(editor).append(inputElement);
// Handle editor value changes
inputElement.on('input', function () {
// Update the editor value to synchronize with the input
editor.val(inputElement.val());
});
}
inputEditor = editor.find("input[type='number']");
selectEditor = editor.find("select");
},