<ejs-spreadsheet id="spreadsheet" cellEdit="onCellEdit">
<e-spreadsheet-sheets>
<e-spreadsheet-sheet>
<e-spreadsheet-rangesettings>
<e-spreadsheet-rangesetting dataSource="ViewBag.DefaultData"></e-spreadsheet-rangesetting>
</e-spreadsheet-rangesettings>
</e-spreadsheet-sheet>
<e-spreadsheet-sheet>
<e-spreadsheet-rangesettings>
<e-spreadsheet-rangesetting dataSource="ViewBag.DefaultData"></e-spreadsheet-rangesetting>
</e-spreadsheet-rangesettings>
</e-spreadsheet-sheet>
</e-spreadsheet-sheets>
</ejs-spreadsheet>
<script>
function onCellEdit(args) {
if (this.activeSheetTab === 1) {
args.cancel = true;
}
if (this.activeSheetTab === 2) {
var i = args.address.indexOf("!") + 1;
var colIndex = [];
var address = args.address.substr(i, args.address.length);
colIndex = ejs.spreadsheet.getCellIndexes(address);
console.log(colIndex);
var col = 0;
if (col === colIndex[1]) {
args.cancel = true;
}
}
}
</script>
|