I am trying to make only 3 specific cells editable and all the rest, readonly. I tried the isEditableCell function for the 3 specific cells while turning the column's editable property off. It seems the column/editable function supersedes the isEditableCell function. Is it possible to make only 3 specific cells editable?
Below is the code I am using:
var grid2 = pq.grid("#KPMGData", {
height: 500,
width: '100%',
sortableType: false,
showTitle: false,
header: false,
autoRow: true,
editor: { select: true, type: 'textbox' },
selectionModel: {column: true},
animModel:{on: true},
colModel: [
{dataIndx: 0, title: "A", align: "left", width: 300, editable: false},
{dataIndx: 1, title: "B", align: "right", width: 100, editable: false},
{dataIndx: 2, title: "C", align: "right", width: 100, editable: false, dataType: "float", dataIndx: "revenues", format: '###,###.00'},
{dataIndx: 3, title: "D", align: "right", width: 100, editable: false},
{dataIndx: 4, title: "E", align: "right", width: 100, editable: false},
{dataIndx: 5, title: "F", align: "right", width: 100, editable: false},
{dataIndx: 6, title: "G", align: "right", width: 100, editable: false},
{dataIndx: 7, title: "H", align: "right", width: 100, editable: false},
{dataIndx: 8, title: "I", align: "right", width: 100, editable: false},
{dataIndx: 9, title: "J", align: "right", width: 300, editable: false},
{dataIndx: 10, title: "K", align: "right", width: 300, editable: false}
],
editor:{type:'textarea'},
editModel: {
onSave:'downFocus'
}
});
grid2.showLoading();
pq.excel.importXl( {url: '/sts/content/files/data/KPMG.xlsx'}, function( wb ){
grid2.importWb({ workbook: wb, extraRows: 0, extraCols: 20, keepCM: true });
})
grid2.isEditableCell( { rowIndx: 14, dataIndx: 3 } );
grid2.isEditableCell( { rowIndx: 17, dataIndx: 3 } );
grid2.isEditableCell( { rowIndx: 18, dataIndx: 3 } );
grid2.hideLoading();