My purpuse is that “Only specific cells which have data initially are readOnly. Others are not readOnly”
I would like to create a row with readOnly = false when I insert a new row.
I set my cells when I mount table data with updateSettings() like this.
const initialArray = [ {id: 1, name: "test1"}, {id: 2, name: "test2"} , {id: 3, name: "test3"} ]
cells: function(row, col) {
const cellProperties = {};
if(col === 1 && initialArray.name[row]) {
cellProperties.readOnly = true;
}
return cellProperties
};
However, I couldn’t change my cellMeta when I set new cellMeta with beforeCreateRow.
beforeCreateRow: function(index, amount, source) {
this.$refs.hot.hotInstance.setCellMetaObject(index, 1, {
readOnly: false
});
}
How do I solve my problem? When I create a new row below inital Data, it was readOnly = false, but when I create a new row between initial data, it musut be readOnly = true.