Hi, I'm new here, can anyone can help me with my problem? When I click the Add new record, the dropdown list in column Item is disabled but the rest of the rows are enabled. See image below.
We recently updated the functionality of the Data Table control and have not yet updated the code examples in the documentation. Please try out this code:
var merch = {};
merch['Baseball cap'] = 9.99;
merch['T-shirt'] = 19.99;
merch['Key chain'] = 4.99;
fd.rendered(function () {
var dt = fd.control('DataTable1');
const unitPriceColumn = dt.columns.find(c => c.field === 'UnitPrice');
unitPriceColumn.editable = () => false;
dt.$on('change', function (value) {
if (value) {
for (var i = 0; i < value.length; i++) {
value[i].set('UnitPrice', merch[value[i].Product] || 0);
}
}
});
});
Thank you so much. It works fine but the Data Table won't get updated. If I add the dt.widget.refresh(), the dropdown list in column Item is disabled just like before.
The column Action/Activities will get refreshed if it receives a focus but not disabled. If disabled, the dt.widget.refresh() will do but the dropdown list in column will be disabled.