Selectize.js: Poor performance with large lists

Created on 9 Aug 2016  路  8Comments  路  Source: selectize/selectize.js

I have a selectize list with +7000 items.
The page gets really slow and noticeable laggy (angular).
What's the best approach to deal with this issue?

this is the list options code:

vm.selectize_clientes = { options: [] };
            vm.selectize_clientes.options = vm.selectize_cliente_data;
            vm.selectize_clientes_config = {
                create: false,
                maxItems: 1,
                maxOptions: 999999999,
                placeholder: '',
                valueField: 'email',
                labelField: 'nome',
                searchField: ['nome', 'email'],
                render: {
                    option: function (clientes, escape) {
                        return '<div class="option">' +
                            '<span class="title">' + escape(clientes.nome) + ' - ' + escape(clientes.login) + '</span>' +
                            '</div>';
                    },
                    item: function (clientes, escape) {
                        return '<div class="item">' + escape(clientes.nome) + ' - ' + escape(clientes.login) + '</div>';
                    }
                }
            };
<div class="uk-margin-bottom" id="clientesDiv">
                                        <label for="cliente">Cliente</label>
                                        <input ng-model="vm.mensagem.userKey" type="text" config="vm.selectize_clientes_config" options="vm.selectize_clientes.options"
                                            name="cliente" id="cliente" selectize />
                                    </div>
no-issue-activity performance

All 8 comments

Have you checked out #1084 #1105? Looks like it's the same issue. Can you profile your situation and report your findings there?

1084 does not seem to be the problem, since it happens on all browsers.

Selectize is loadign the list quite fast. The problem is that typing in any other inputs in the page, it gets laggy and slow.
Ps: I'm using selectize with angular.

@thiagosoeiro I confirm it. Is there some improvements?

@matte00 don't seems to be any improvement until now but after reducing maxOptions we can see the difference.

Same issue here after few years. Any fix on this? Even on the other issues there's no fix to this. I had to ajaxify everything but still freeze the page.

Yes, ajax or websockets is the only way to solve this problem. Do not load 7,000 list

nodes, browser memory is expensive, think mobile as well. Just display what the user needs to see at all times to ensure maximum optimization.

I have to let the user choose from all the italian province, and there are over 8.000 names that I can't reduce for several obvious reasons. So it's a render/browser/memory issue... is that for sure? Or someone did some tricks to get something lighter?

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreypopp picture andreypopp  路  15Comments

nesl247 picture nesl247  路  37Comments

Wardrop picture Wardrop  路  19Comments

ghost picture ghost  路  60Comments

CarlosLlongo picture CarlosLlongo  路  18Comments