Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
425 views
in Technique[技术] by (71.8m points)

javascript - Bootstrap MultiSelect clickable optgroups

I am using Bootstrap multi-select for a list of countries and football leagues with those countries. I want the interface to be as easy as possible so I have enabled the following options

 enableClickableOptGroups: true,
 enableCollapsibleOptGroups: true,
 collapseOptGroupsByDefault: true,

The works great as it allows me to keep the initial list manageable but the user can expand to select individual leagues

enter image description here

The only flaw is that if you click anywhere on the row except exactly on the down arrow it selects all the items in that optgroup, which from a user experience point of view isnt great. So for example if I click to the far right of Albania but in the same row in my example it still selects all

I have created a JSfiddle here https://jsfiddle.net/mikehobson/w53c2vd8/8/

I want the behaviour that if I click the check box only it selects all the options under the optgroup, if I click anywhere else on that line it expands it but im not sure if this is possible or if I have done something wrong

question from:https://stackoverflow.com/questions/65902760/bootstrap-multiselect-clickable-optgroups

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...