Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4838

Fastest Filtering Method

$
0
0

@aricallen wrote:

I have a simple app that utilizes an ember data model and a input field to search for and display matches. On load the page is drawn with each model in a series of rows (roughly a thousand). On each keyup, I take the query from the search box, make a regex and loop over the model to see which have a fullName property that passes the /query/.test(). If it passes, I set a flag of shouldShowInList to true.

I've tried a few different methods like using an {{if model.shouldShowInList}} to draw the row with the model. As well as using the same flag for adding a hidden class on the row markup like so {{if model.shouldShowInList 'is-hidden'}}.

After some profiling, I found that adding the 'is-hidden' class is remarkably faster however the filtering can still slow the app down to a crawl, especially when deleting the query since this is when the DOM is being reloaded with all of the model.

I'm wondering what other people have found to be the quickest way to perform a model filtering on the front-end for a similar situation?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4838

Trending Articles