function bindEvent(sheet,lastRow){
var textCellType = new GcSpread.Sheets.TextCellType();
spread.bind(GcSpread.Sheets.Events.EnterCell,function(event, data) {
if (data.row > lastRow) {
var columnId = columnIdObj[data.col];
if (data.col in dicColumn) {
var combo = cache.getCache(dicColumn[data.col]);
sheet.getCell(data.row, data.col,spreadNS.SheetArea.viewport).cellType(combo).tag({'columnId':columnId});
//console.log("col:" + data.col + "row:"+ data.row);
} else {
sheet.getCell(data.row, data.col).cellType(textCellType).tag({'columnId':columnId});
}
}
});
spread.bind(GcSpread.Sheets.Events.LeaveCell,function(event, data) {
var v = sheet.getValue(data.row, data.col);
if(!hasLength(v)){
sheet.getCell(data.row, data.col).cellType(textCellType);
}
});
}
|
|