Increasing performance with long options list

Increasing performance with long options list

tegra_andrewtegra_andrew Posts: 7Questions: 2Answers: 0

Hello,

For my editor, I have a select2 that's drawing from a long list of options (8000+). Since I'm loading all these in the initial JSON data, it's causing pretty large performance issues. Is there a way to lazy load this list instead of including it in the initial JSON load?

Thanks,

Andrew

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Answer ✓

    Hi Andrew,

    Yes, Select2 has remote data options. Their documentation for it is here.

    One of the key things to consider when implementing it with Editor is that you need to take account of the initialValue parameter that is set to the server when the form is shown (so it can return the value / label for the current value).

    Allan

  • tegra_andrewtegra_andrew Posts: 7Questions: 2Answers: 0

    Hey Allan, thanks for your help. I was able to get that working, but I was wondering if there is a way to lazy load data with search panes too?

  • tegra_andrewtegra_andrew Posts: 7Questions: 2Answers: 0

    Or could I paginate the search pane with server side data? What would the AJAX load for something like that look like?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You can use SearchPanes with the open-source Editor server-side libraries - this example demonstrates how to do that.

    Colin

Sign In or Register to comment.