Implement Select2 as a replacement for standard and API backed selection fields. #2263

Closed
opened 2025-12-29 17:24:18 +01:00 by adam · 1 comment
Owner

Originally created by @lampwins on GitHub (Jan 5, 2019).

Environment

  • Python version: 3.6
  • NetBox version: 2.5.2

Proposed Functionality

For some time we have wanted to enhance the UI selection fields to allow for more dynamic API interaction. Select2 is a very popular solution for this, and initial testing confirms it is an appropriate choice.

Several recent and outstanding issues will be covered as a part of this, including #2516, #2590, and #2735.

Use Case

We will use Select2 to replace:

  • All instances of Livesearch fields which are used to query the API in real time for a model instance.
  • All model backed choice fields which will allow us to handle large datasets via pagination (infinite scrolling).
  • All chained choice fields, refactoring the related server-side code and replacing the JS code for this along the way.
  • Tag fields which will allow us to make use of autocomplete and an overall improved UI for tags.
  • Model backed multi selection fields which will look and feel much like the tagging interface.
  • Static choice selection fields when appropriate. This will help in maintaining a consistent UI for selection.

Database Changes

None

External Dependencies

There will be a new dependency on Select2. This includes minified JS and CSS files in project-static assets along with Select2's related i18n files. This will be handled the same as the other JS dependencies like jQuery.

Originally created by @lampwins on GitHub (Jan 5, 2019). <!-- NOTE: This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6 * NetBox version: 2.5.2 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality For some time we have wanted to enhance the UI selection fields to allow for more dynamic API interaction. [Select2](https://select2.org/) is a very popular solution for this, and initial testing confirms it is an appropriate choice. Several recent and outstanding issues will be covered as a part of this, including #2516, #2590, and #2735. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case We will use Select2 to replace: - All instances of Livesearch fields which are used to query the API in real time for a model instance. - All model backed choice fields which will allow us to handle large datasets via pagination (infinite scrolling). - All chained choice fields, refactoring the related server-side code and replacing the JS code for this along the way. - Tag fields which will allow us to make use of autocomplete and an overall improved UI for tags. - Model backed multi selection fields which will look and feel much like the tagging interface. - Static choice selection fields when appropriate. This will help in maintaining a consistent UI for selection. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes None <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies There will be a new dependency on [Select2](https://select2.org/). This includes minified JS and CSS files in project-static assets along with Select2's related i18n files. This will be handled the same as the other JS dependencies like jQuery.
adam added the status: accepted label 2025-12-29 17:24:18 +01:00
adam closed this issue 2025-12-29 17:24:18 +01:00
Author
Owner

@lampwins commented on GitHub (Jan 5, 2019):

Work has commenced in the select2-ui branch.

@lampwins commented on GitHub (Jan 5, 2019): Work has commenced in the `select2-ui` branch.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2263