Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.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 可手持:动态加载单元格-视口事件?_Javascript_Handsontable - Fatal编程技术网

Javascript 可手持:动态加载单元格-视口事件?

Javascript 可手持:动态加载单元格-视口事件?,javascript,handsontable,Javascript,Handsontable,我通过ajax加载数据,因此在用户更改视图(滚动或键盘导航)之前,我不必加载不需要的单元格 到目前为止,我已经使用了“autoColumnSize”和“autoRowSize”插件来处理滚动(下面的代码摘录),但它似乎很复杂,不能处理键盘导航 var colPlugin = hot.getPlugin('autoColumnSize'); var rowPlugin = hot.getPlugin('autoRowSize'); // ...plugin enabled here... hot.

我通过ajax加载数据,因此在用户更改视图(滚动或键盘导航)之前,我不必加载不需要的单元格

到目前为止,我已经使用了“autoColumnSize”和“autoRowSize”插件来处理滚动(下面的代码摘录),但它似乎很复杂,不能处理键盘导航

var colPlugin = hot.getPlugin('autoColumnSize');
var rowPlugin = hot.getPlugin('autoRowSize');
// ...plugin enabled here...
hot.addHook('afterScrollHorizontally', loadViewportData });
hot.addHook('afterScrollVertically', loadViewportData });

function loadViewportData () {
        var rowStart = rowPlugin.getFirstVisibleRow();
        var rowEnd = rowPlugin.getLastVisibleRow();
        var colStart = colPlugin.getFirstVisibleColumn();
        var colEnd = colPlugin.getLastVisibleColumn();
        // ...add +1/-1 to indexes to handle partially visible cells if within the table ...
        request =ajaxGetData(colStart, colEnd, rowStart, rowEnd);
        request.done(function (d) {
               // update table with the data...
        }
};

core中是否存在处理视口更改的事件,并将提供视图范围。或者我应该使用完全不同的方法吗?

不确定您到底想要什么。您是否尝试了
scrollViewportTo