更改后的jexcel表SUM列

时间:2018-10-04 09:09:09

标签: javascript jquery

输入值后,我想在jexcel中求和

此代码不起作用,我不知道为什么:

var change = function(instance, cell, value) {
var cellName = $(instance).jexcel('getColumnNameFromId',$(cell).prop('id'));

$('#log').append('New change on cell'+ cellName+'to:'+ value + '<br>');

var thisid = $(cell).prop('id');
var splitted = thisid.split("-");
var nextcellid = ++splitted[1];
var nextcell = '0-'+nextcellid;
console.log(nextcell,'nextcell');
$("td#"+nextcell).html('<span>total</span>');
}

2 个答案:

答案 0 :(得分:1)

使用 [ { "id":123, "cloudStatusTimestamp":"2019-01-21T15:45:06.823", "cloudStatusCode":null, "cloudStatusMessage":"300: PDF generated successfully", "cloudStatusComments":"Inbound invoice", "Reference": 123 }, { "id":436, "cloudStatusTimestamp":"2019-02-21T05:45:06.423", "cloudStatusCode":null, "cloudStatusMessage":"300: PDF generated successfully", "cloudStatusComments":"Inbound invoice, Reference: 456" } ] 事件:

onafterchange

完整处理事件已准备好此网址 https://bossanova.uk/jexcel/docs/events

或使用此示例

https://bossanova.uk/jexcel/examples/including-formulas-on-your-spreadsheet

答案 1 :(得分:0)

说实话,您可以在想要总计的列中使用= SUM(A1:A10)。非常像excel。