本帖最后由 Alice 于 2016-9-12 11:16 编辑
谢谢您的反馈。
SpreadJS本身提供了CellClick/CellDoubleClick事件,该事件的使用可以参考产品文档:
- http://sphelp.grapecity.com/webhelp/SpreadJSWeb/webframe.html#JavascriptLibrary~GcSpread.Sheets.Events~CellClick_EV.html
复制代码
代码参考:
- 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);
- });
复制代码
如果是想处理鼠标的相关事件,只能给Dom元素添加鼠标事件。
添加行,可以通过addRows方法,产品文档:http://sphelp.grapecity.com/webhelp/SpreadJSWeb/webframe.html#scbindadd.html
删除行,可以通过deleteRows方法,产品文档:http://sphelp.grapecity.com/webhelp/SpreadJSWeb/webframe.html#JavascriptLibrary~GcSpread.Sheets.Sheet~deleteRows.html
|