Call getFilterKey() instead of filterKey ivar

This commit is contained in:
Kevin Sawicki
2014-02-14 08:45:31 -08:00
parent 65dafd58c1
commit 0e3b6628f3

View File

@@ -136,7 +136,7 @@ class SelectListView extends View
filterQuery = @getFilterQuery()
if filterQuery.length
filteredArray = fuzzyFilter(@array, filterQuery, key: @filterKey)
filteredArray = fuzzyFilter(@array, filterQuery, key: @getFilterKey())
else
filteredArray = @array
@@ -214,6 +214,19 @@ g
# item - The selected model item.
confirmed: (item) ->
# Public: Get the property name to use when filtering items.
#
# This method may be overridden by classes to allow fuzzy filtering based
# on a specific property of the item objects.
#
# For example if the objects you pass to {.setItems} are of the type
# `{"id": 3, "name": "Atom"}` then you would return `"name"` from this method
# to fuzzy filter by that property when text is entered into this view's
# editor.
#
# Returns a {String} property name to fuzzy filter by.
getFilterKey: ->
attach: ->
@storeFocusedElement()