When setting the “clipboard” property to “block” on Datatable, the component will paste data from the clipboard (multiple rows and columns from Excel) the way I need, but will not add additional rows if the clipboard contains more rows than the Datatable has. Lets say the Datatable has 1 empty row and I paste 5 rows from Excel, it will paste one row, but I want it to add 4 more rows and paste into it as well. Can anyone help with this? Is there a property I’m missing where I can tell the component to automatically add rows if required?
Any update on this?
Please check the next snippet
https://snippet.webix.com/idoiqv9r
You can use onPaste event, from which code can count the rows to be pasted, compare it with grid size and add the extra rows when necessary.
onPaste: function(text){
var rows = webix.csv.parse(text).length;
var indexes = this.getSelectedId(true).map( a => this.data.getIndexById(a) ).sort();
var diff = indexes[0] + rows - this.data.count();
for (;diff>0;diff--){
this.add({})
}
}