var listview=Forguncy.Page.getListView("表格1");
var spread=listview.getControl();
var sheet = spread.getActiveSheet()
sheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function(a,b){
console.log(b);
var row=b.sheet.getActiveRowIndex()+1;
var col=b.sheet.getActiveColumnIndex()+1;
var val=listview.getValue(row-1,col+1); //获取选中的单元格的值
var colName=b.sheet.getValue(0, b.sheet.getActiveColumnIndex(),
GC.Spread.Sheets.SheetArea.colHeader);
Forguncy.Page.getCell("hang").setValue(row);
Forguncy.Page.getCell("lie").setValue(col);
Forguncy.Page.getCell("biaoti").setValue(colName);
Forguncy.Page.getCell("zhi").setValue(val);
}
);
用上面代码可解决。行,列,标题,值 对应单元格命名hang,lie,biaoti,zhi.
原来的插件,应该是偏移值多了 |