handsontable / hot-table

Handsontable - Best Data Grid Web Component with Spreadsheet Look and Feel.
http://handsontable.github.io/hot-table/
MIT License
131 stars 36 forks source link

Selection when focus lost #33

Open thebrauer opened 8 years ago

thebrauer commented 8 years ago

Is it possible for the table to keep the selection when it loses focus? It seems to always set -1 as selectedIndex now.

AMBudnik commented 8 years ago

Hi @thebrauer I'm not sure what you would like to achieve.

You can grammatically select a cell by the selectCell() method you can also prevent the table of loosing focus (when you click outside the table) with outsideClickDeselects option set to false like in this example: http://jsfiddle.net/563vq3ku/

thebrauer commented 8 years ago

The server programmer told me that sending -1 to the server created some issues for him and I am afraid I don't know what.

Can outsideClickDeselects be added as a property to this?:

<hot-table id="Hot-table1" datarows="{{model.Modules.Selectables}}" class="htLeft" stretch-h="all" highlighted-row="{{model.Modules.SelectedIndex$}}" manual-column-move manual-column-resize fill-handle="false" column-sorting sort-indicator prevent-overflow="horizontal">
    <hot-column value="NameUrl" header="Name" read-only renderer="html"></hot-column>
    <hot-column value="Version" header="Version" read-only></hot-column>
    <hot-column value="OS" header="OS" read-only></hot-column>
    <hot-column value="Platform" header="Platform" read-only></hot-column>
</hot-table>
AMBudnik commented 8 years ago

I'm not an expert in Hot-table but as I was told by one of our devs it should work.

vchuquimia commented 6 years ago

outsideClickDeselects option set to false

this option works for this issue, thank you dude.