isteven / angular-multi-select

A multi select dropdown directive for AngularJS. Allows you to use HTML tags and CSS in the data. Requires only AngularJS and nothing else.
isteven.github.io/angular-multi-select
MIT License
1.08k stars 518 forks source link

Max rows displayed option #459

Closed T89L closed 7 years ago

T89L commented 8 years ago

Why not solve performance issues on large result sets by adding a max rows displayed attribute? I added this, put a limitTo filter on the repeat for the results display, and put a "Display first X rows" at the bottom with a ng-if checking if the filteredresults length is > the max rows.

The search function still works this way and now the enormous lag (I have ~5k records sometimes) is completely gone. The code is very minimal, but I can create a pull request if you'd like.

Thank you for this excellent control!

isteven commented 8 years ago

@tim-lukacik

Tim, a pull request would be appreciated. Just make sure it works will all the features (grouping, filtering, select all, none, reset, etc).

Wingie commented 8 years ago

Yes, im also facing a lot of performance issues with this control.. could you share your code?

T89L commented 8 years ago

@Wingie Take a look at #460. I found a limit of 500 to work acceptably on my machine so I suggested that as default. Seems to work with everything. It's just limiting what's displayed, not actually touching any arrays. It could potentially cause a group to not be fully listed if the group happens to be around the limit.

T89L commented 8 years ago

A better solution would be pagination here instead :)

Wingie commented 8 years ago

Or maybe a solution that involved "virtual rows" or something.. like writing only the visible elements to the DOM.. because from what i'm seeing the issue is the angular double binding and large number of watchers.

i have the need to put multiple dynamically changing multiselects on a single page.. and sometimes chrome gets stalled because of the performance issues.

[Wilson Wingston Sharon]

On Wed, Jul 20, 2016 at 7:01 PM, Tim Lukacik notifications@github.com wrote:

A better solution would be pagination here instead :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/isteven/angular-multi-select/issues/459#issuecomment-233976593, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIj5Fwd6Ga7siFLchxxDf_jT19pNvliks5qXjgugaJpZM4JLpWh .

T89L commented 8 years ago

If you haven't already, check out ui-grid.