Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding columns to spreadsheet #25

Open
CarrotKutay opened this issue Mar 24, 2022 · 0 comments
Open

Adding columns to spreadsheet #25

CarrotKutay opened this issue Mar 24, 2022 · 0 comments

Comments

@CarrotKutay
Copy link

Hello There!
I have been working on an implementation using your plugin. Thanks btw for this work its helping me a lot :D
I stumbled upon one issue with inserting columns to the spreadsheet

function(){var r=e.selector.range,i=r.sri,o=r.sci,a=e.rows,l=e.merges,c=e.cols,s=i;"row"===t?a.insert(i,n):"column"===t&&(a.insertColumn(o,n),s=o,c.len+=1) -> at file xspreadhsheet.js

// type: row | column
insert(type, n = 1) {
this.changeData(() => {
const { sri, sci } = this.selector.range;
const { rows, merges, cols } = this;
let si = sri;
if (type === 'row') {
rows.insert(sri, n);
} else if (type === 'column') {
rows.insertColumn(sci, n);
si = sci;
cols.len += 1; // am I seeing this correctly that no matter the number defined for inserting the actual number to insert will only ever increased by 1?
}
merges.shift(type, si, n, (ri, ci, rn, cn) => {
const cell = rows.getCell(ri, ci);
cell.merge[0] += rn;
cell.merge[1] += cn;
});
});
}

-> at file data_proxy.js

cols.len += n is probably the wanted code, or was this done on purpose? Please care to explain, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant