jspreadsheet / ce

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.
https://bossanova.uk/jspreadsheet/v4
MIT License
6.77k stars 828 forks source link

Can I programmatically blur jspreadsheet? #1355

Closed Geddes-C closed 3 years ago

Geddes-C commented 3 years ago

I would like to programmatically blur jspreadsheet then focus on another HTML element, such as:

document.getElementById("spreadsheet").blur() document.getElementById( ... ).focus();

However, this does not seem to work. Is it possible?

Many thanks and best wishes.

GBonnaire commented 3 years ago

hi

yes it's possible :

for blur use myTable.resetSelection(true); ordocument.getElementById("spreadsheet").jspreadsheet.resetSelection(true);

for focus use : myTable.updateSelectionFromCoords(0,0,0,0) or document.getElementById("spreadsheet").jspreadsheet.updateSelectionFromCoords(0,0,0,0)

Geddes-C commented 3 years ago

Great - thanks for your help. Best wishes.