Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing compound editors in handsontable

In this example you can cancompound cell editors driving multiple fields from one cell.
http://mleibman.github.com/SlickGrid/examples/example3a-compound-editors.html

I am wondering if ti is possible to make it also for jquery-handsontable.

Any hints how to make it by using handsontable?

Thanks

like image 767
Lorraine Bernard Avatar asked Dec 29 '25 22:12

Lorraine Bernard


1 Answers

Interesting question. That is a little bit challenging but it is surely doable.

Just take a look at the source of CheckboxEditor and CheckboxRenderer to see how to insert a <input> editor inside a cell:

  • https://github.com/warpech/jquery-handsontable/blob/master/src/editors/checkboxEditor.js
  • https://github.com/warpech/jquery-handsontable/blob/master/src/renderers/checkboxRenderer.js

Double that and change input type to text and you will have a compund text editor.

That said, I am not big fan of this concept because it breaks standard flow of working with a spreadsheet. It would be hard to maintain the current keyboard experience. Normally, you expect that the effect of pressing enter or keyboard arrows on a cell would be simmilar as in Excel.

like image 67
warpech Avatar answered Jan 01 '26 12:01

warpech