Skip to content

How optimizing Selectize Performance by Centralizing Options Lists? #6

@TavioBRMG

Description

@TavioBRMG

I'm using the Selectize library and facing a challenge. The page I'm building repeatedly creates the same "select" element with a large list of options, which affects performance. These elements are added dynamically when the page loads.

I want to know if it's possible to link the options list of the duplicated inputs to a "central list" to avoid rendering multiple "selectize-dropdown-content" with the same content. I've researched extensively but couldn't find an easy solution. If necessary, I can create a plugin, although I'm not familiar with the library.

Example:

const Options = [
  { value: 'option1', text: 'Opção 1' },
  { value: 'option2', text: 'Opção 2' },
];

$('#select1').selectize({
  options: Options,
});

$('#select2').selectize({
  options: Options,
});

Result:
WKakSpwX

These are the same options, no need to load them repeatedly. Ideally, the only resource to maintain would be the uniqueness of each select, such as input, cache...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions