Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
updateData(mod = 10) {
// Just assigning setting each tenth this.data doesn't cause a redraw, the following does:
var newData = this.data.slice(0);
var expr = san.parseExpr('rows[0].label');
for (let i = 0; i < this.data.length; i += mod) {
let newRow = Object.assign({}, this.data[i], { label: this.data[i].label + ' !!!' });
newData[i] = newRow;
this.fires.push({
type: 1,
expr: {
type: expr.type,
paths: [
expr.paths[0],
{ type: expr.paths[1].type, value: i },
expr.paths[2]
],
raw: 'rows[' + i + '].label'
},
value: newRow.label,
option: {}
updateData(mod = 10) {
// Just assigning setting each tenth this.data doesn't cause a redraw, the following does:
var newData = this.data.slice(0);
var expr = san.parseExpr('rows[0].label');
for (let i = 0; i < this.data.length; i += mod) {
let newRow = Object.assign({}, this.data[i], {label: this.data[i].label + ' !!!'});
newData[i] = newRow;
this.fires.push({
type: 1,
expr: {
type: expr.type,
paths: [
expr.paths[0],
{type: expr.paths[1].type, value: i},
expr.paths[2]
],
raw: 'rows[' + i + '].label'
},
value: newRow.label,
option: {}