Netbox: Implement Select2 as a replacement for standard and API backed selection fields.

Created on 5 Jan 2019  路  1Comment  路  Source: netbox-community/netbox

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.

accepted

Most helpful comment

Work has commenced in the select2-ui branch.

>All comments

Work has commenced in the select2-ui branch.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robbagithub picture robbagithub  路  3Comments

benjy44 picture benjy44  路  3Comments

Grokzen picture Grokzen  路  3Comments

mrfroggg picture mrfroggg  路  3Comments

VictorJ76 picture VictorJ76  路  3Comments