silverstripe-bootstrap-forms icon indicating copy to clipboard operation
silverstripe-bootstrap-forms copied to clipboard

chosen dropdowns, class chosen not set

Open jberculo opened this issue 7 years ago • 1 comments

Could there be an issue with the chosen dropdowns? I've got two installs, and on both the class "chosen" is not set, so the dropdowns are not initialised.

jberculo avatar Sep 27 '16 15:09 jberculo

I had problems with the "normal" DropdownField too.

I think it's because of the newly added BootstrapDropdownField(.php/.ss) which results in a DropdownField always being rendered with BootstrapDropdownField.ss (in your case: where $extraClass is not added to the select tag and the select tag is wrapped) even if i don't want that button/dropdown/toggle functions.

BootstrapFieldList.php line 55
$bootstrapCandidate = "Bootstrap{$className}"

Some other features weren't working as expected either (setEmptyString or setSource or Dropdownfield not working correctly with BootstrapDropdownField.ss and BootstrapDropdownField missing some features)  - I don't remember exactly.

I wanted to add the bootstrap-select library (https://silviomoreto.github.io/bootstrap-select/) myself so I had to override the BootstrapDropdownField.ss template to get the standard DropdownField rendered (copied silverstripe-framework/templates/forms/DropdownField.ss and renamed it to BootstrapDropdownField.ss). Maybe this workaround works for the chosen-dropdown as well.

@unclecheese @colinedmz Maybe the BootstrapDropdownField class and template should be renamed to BootstrapSelectDropdownField (or similar) to avoid those conflicts?

derralf avatar Oct 12 '16 12:10 derralf