Hi
I have a problem with datagrid while using updateRow, the example below is my datagrid that im using
$('#example-dg').datagrid({
columns: [[
{ field: 'waluta', title: 'Waluta', width: '80px', align: 'center', editor: { type: 'combobox', options: { textField: 'nazwa_waluta', valueField: 'waluta', url: 'link/to/query.php' } }, formatter: function (value, row, index) {
return row.nazwa_waluta;
}},
]],
rownumbers: 'true',
showFooter: 'true',
singleSelect: 'true',
idField: 'id',
onEndEdit: function (index, row) {
const ed = $(this).datagrid('getEditor', {
index: index,
field: 'waluta'
});
row.nazwa_waluta = $(ed.target).combobox('getText');
});
and this is the combobox with other onchange that im using to massUpdate the field "waluta"
$('#example-combobox').combobox({
onChange: function(newValue, oldValue) {
const dg = $('#example-dg');
if (newValue != '' && !isNaN(newValue)) {
const rows = dg.datagrid('getRows');
$.each(rows, function (i, e) {
e.waluta = parseInt(newValue);
dg.datagrid('updateRow', { index: i, row: e });
});
}
}
});
If i change the value in "$('#example-combobox')", datagrid is not refreshing with new data but if i beginEdit the new data is shown in combobox