lorenzofox3 / Smart-Table

Code source of Smart Table module: a table/grid for Angularjs
http://lorenzofox3.github.io/smart-table-website/
1.8k stars 513 forks source link

Evaluate Multi-/Single-Select with a scope #789

Open KabaTheBear opened 7 years ago

KabaTheBear commented 7 years ago

I want to change the option of multi-/single-select on the fly, by pressing a button to change a scope to "multiple or "" which should be evaluated by "st-select-mode" like in:

st-select-mode="selectionmode" or st-select-mode="{{selectionmode}}".

But this doesnt work. In the documentation is mentioned for single-select : dont specifiy a select mode. I thought if angularJS evaluates a blank string it would be single.

Any Idea how i can achieve this "on the fly change".

MrWook commented 7 years ago

Hello @KabaTheBear,

quick look into the source code and everything will be revealed.

SPOILER: You can set it with "single" instead of "multiple". Also what i can see is that this select mode is not designed to be dynamic. Line 338: var mode = attr.stSelectMode || stConfig.select.mode; What i undestand from it is that it either hardcopied from the attribute or is selected from the config. You could create a PR for this, i guess