Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pagination and filtering for select2 fields #2615

merged 11 commits into from Jul 22, 2016


None yet
3 participants
Copy link

commented Jul 14, 2016

So far we are building select2 fields by attaching them to regular select fields. The regular field is the master field controlling the available options and the selected value. This had some benefits. It made it trivial to transition from regular select to select2 fields since both had the same value behavior. By changing the css styles we also ensured that both fields looked the same. In the past this was helpful since a mix of the two was used in many views and select2 fields were introduced later down the road. Beyond this regular select fields are easier to use e.g. when setting values, val() is very robust while it fails for select2 (3.5.1) when the options are filtered through a query or ajax call or a multiple selection field is served an atomic value. Also val for select2 does not return null or undefined if a value is not selected but an empty string. These minor issues however can be solved by directly setting and reading the data attribute after filtering and assembling select2 formatted dictionaries or dictionary lists.
When it comes to the benefits of standalone select2 fields, they do have a huge performance advantage over select2 fields attached to regular selects, particularly when dealing with large lists of available options (>1000). This is the reason why we revised the default selection view here such that it builds standalone select2 fields which benefit from select2's pagination and query features. Due to user preferences, regular select fields are still available but only for multiple data selection fields and limited to a certain number of options (<100). If the number is larger the field is displayed as select2 field.

@guerler guerler force-pushed the guerler:select_performance branch from 7aa3e0f to f239a0a Jul 14, 2016

@guerler guerler added status/review and removed status/WIP labels Jul 18, 2016


This comment has been minimized.

Copy link

commented Jul 22, 2016

Seems to be working well for me, merging externally to rebuild.

@dannon dannon merged commit 0372bdb into galaxyproject:dev Jul 22, 2016

4 checks passed

api test Build finished. 220 tests run, 0 skipped, 0 failed.
continuous-integration/travis-ci/pr The Travis CI build passed
framework test Build finished. 110 tests run, 0 skipped, 0 failed.
toolshed test Build finished. 582 tests run, 0 skipped, 0 failed.

dannon added a commit that referenced this pull request Jul 22, 2016

@martenson martenson modified the milestones: 16.07, 16.10 Jul 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.