经检验,这两句获不到在cell输入的值啊
<script type="text/javascript">
$(document).ready(function () {
var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"), { sheetCount: 1 });
//initSpread(spread);
var activeSheet = spread.getActiveSheet();
//activeSheet.isPaintSuspended(true);
//i,j;
activeSheet.bind(GcSpread.Sheets.Events.CellClick, function (sender, args) {
if(args.sheetArea === GcSpread.Sheets.SheetArea.colHeader){
console.log("The column header was clicked.");
}
if(args.sheetArea === GcSpread.Sheets.SheetArea.rowHeader){
console.log("The row header was clicked.");
}
if(args.sheetArea === GcSpread.Sheets.SheetArea.corner){
console.log("The corner header was clicked.");
}
//console.log("Clicked column index: " + args.col);
//console.log("Clicked row index: " + args.row);
i = args.col;
j = args.row;
document.getElementById("colindex").innerHTML=i;
document.getElementById("rowindex").innerHTML=j;
//activeSheet.setValue(j,i,"select");
document.getElementById("getvalue").innerHTML = activeSheet.getValue(j,i);
});
//activeSheet.isPaintSuspended(false);
});
</script>
只有先activeSheet.setValue(j,i,"select");才能用getValue获到值啊 |