-
Notifications
You must be signed in to change notification settings - Fork 5
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
coordinate editing (ability to add more than one row at a time) #434
Comments
would this require batching functionality? |
@jdkent Nope, the backend already supports the ability to add multiple points at once. There is a case where multiple rows are added: if you try and paste at the bottom of the table, the table will automatically add multiple rows to accommodate the paste. If we want to add the ability to right click on the table and insert multiple rows, I could add some sort of option in the right click menu that says "insert 4 rows" or something like that. Would that be an acceptable solution? |
yeah, that could work, here is a solution chatGPT suggested for a variable number of rows (modified based on the example you posted): document.addEventListener("DOMContentLoaded", function() {
function getData() {
return [
['', 'Kia', 'Nissan', 'Toyota', 'Honda', 'Mazda', 'Ford'],
['2012', 10, 11, 12, 13, 15, 16],
['2013', 10, 11, 12, 13, 15, 16],
['2014', 10, 11, 12, 13, 15, 16],
['2015', 10, 11, 12, 13, 15, 16],
['2016', 10, 11, 12, 13, 15, 16]
];
}
var
example3 = document.getElementById('example3'),
settings3,
hot3;
settings3 = {
data: getData(),
rowHeaders: true,
colHeaders: true
};
hot3 = new Handsontable(example3, settings3);
hot3.updateSettings({
contextMenu: {
items: {
"row_above": {
name: 'Add rows above',
callback: function(key, options) {
var numRows = parseInt(prompt("Enter the number of rows to add above:", "1"));
if (isNaN(numRows) || numRows < 1) {
return;
}
hot3.alter('insert_row', hot3.getSelected()[0], numRows);
}
},
"row_below": {
name: 'Add rows below',
callback: function(key, options) {
var numRows = parseInt(prompt("Enter the number of rows to add below:", "1"));
if (isNaN(numRows) || numRows < 1) {
return;
}
hot3.alter('insert_row', hot3.getSelected()[0]+1, numRows);
}
}
}
}
})
}); |
No description provided.
The text was updated successfully, but these errors were encountered: