Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Wijmo-SpreadJS中的事件处理_Javascript_Jquery - Fatal编程技术网

Javascript Wijmo-SpreadJS中的事件处理

Javascript Wijmo-SpreadJS中的事件处理,javascript,jquery,Javascript,Jquery,我正在使用wijmospreadjs,并试图实现事件处理。所以,基本上我想控制单元格的点击 我的代码是这样的: $(document).ready(function () { // code here // initSpread(); }); function initSpread(){ // code here // }; $("#ss").wijspread(); var spread = $("#ss").wijspread("spread"); var activeS

我正在使用wijmospreadjs,并试图实现事件处理。所以,基本上我想控制单元格的点击

我的代码是这样的:

$(document).ready(function () {
  // code here //

  initSpread();

});

function initSpread(){
  // code here //
};

$("#ss").wijspread();
var spread = $("#ss").wijspread("spread");
var activeSheet = spread.getActiveSheet();

activeSheet.bind($.wijmo.wijspread.Events.CellClick, function (sender, args) {
    alert("Cell "+args.col+args.row+" clicked");
});
这将返回错误:

Uncaught TypeError: Object [object Object] has no method 'getActiveSheet'
这个代码有什么问题?
提前感谢您的帮助。

当您创建spreadjs实例时,您应该提供一个工作表计数,否则spreadjs中没有工作表。 $(#ss”).wijspread({sheetCount:1})