Unique dynamic lists using Handlebars

Populating a dropdown from a list that contains duplicate values can be tricky. You need to know how to create a unique list of values, from a source list.

In these screencasts you will learn about the algorithm to convert a list like this:

var fruits = ['apple', 'pear', 'orange', 'kiwi', 'pear', 'orange',
'lemon', 'apple', 'orange', 'pear', 'apple', 'apple', 'kiwi', 'grapes'];

Into a list that looks like this:

[ 'apple', 'pear', 'orange', 'kiwi', 'lemon', 'grapes' ]

And then how to integrate this algorithm into your webpage.

These screencasts show you:

The appliction used in these screencasts is available here and the source code here.

The algorithm to create a unique list of values

Knowing how to create a unique list of values from a list that contains duplicates is the starting point of how to remove duplicates from your dynamically added dropdown data. This is not really about Handlebars, but rather about using an algorithm.


How to create dropdowns with unique values.

Now that you know the algorithm to create a unique list, you need to use this algorithm in your web page.


Filtering dynamically added data

Filtering data using a dynamic list can be tricky in this screencast we look at how to do it and and solve a few problems encountered along the way.