Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.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 自定义渲染器未应用于表render handsontable_Javascript_Web_Handsontable - Fatal编程技术网

Javascript 自定义渲染器未应用于表render handsontable

Javascript 自定义渲染器未应用于表render handsontable,javascript,web,handsontable,Javascript,Web,Handsontable,我有一个自定义的渲染器,用于对我的handsontable中的列求和 这些值仅在编辑单元格时显示,但在表格加载初始数据时不显示 是否存在要加载初始渲染的事件?还是我打错电话了 hot = new Handsontable(container, { data: data, colHeaders: col_headers, rowHeaders: row_headers, colWidths: 110, rowHeights: 30, startRow

我有一个自定义的渲染器,用于对我的handsontable中的列求和

这些值仅在编辑单元格时显示,但在表格加载初始数据时不显示

是否存在要加载初始渲染的事件?还是我打错电话了

hot = new Handsontable(container, {
    data: data,
    colHeaders: col_headers,
    rowHeaders: row_headers,
    colWidths: 110,
    rowHeights: 30,
    startRows: row_count,
    maxRow: row_count,
    maxCols: col_headers.length,
    columns: column_types,
    cells: function(row, col, prop){
        if (row === row_count - 1) {
            this.renderer = sumRenderer;
            var cellProperties = {};
            cellProperties.readOnly = true;
        }
        return cellProperties;
    }
});

var sumRenderer = function (instance, td, row, col, prop, value) {
    var total = 0;
    for (ii = 0; ii < row; ii++) {
         total += instance.getDataAtCell(ii, col);
    };
    value = total;

    Handsontable.renderers.NumericRenderer.apply(this, arguments);
};
hot=新的可手持设备(容器、{
数据:数据,
列标题:列标题,
行标题:行标题,
冷宽:110,
身高:30,
startRows:行数,
maxRow:行数,
maxCols:col_headers.length,
列:列类型,
单元格:函数(行、列、属性){
如果(行===行计数-1){
this.renderer=sumdrenderer;
var cellProperties={};
cellProperties.readOnly=true;
}
归还财产;
}
});
var SUMDrenderer=函数(实例、td、行、列、属性、值){
var合计=0;
对于(ii=0;ii
只要试着将sumRendered声明放在您的可手持对象上方即可

啊,我明白了。仍然习惯于javascript的编译方式:)