API Docs for:
Show:

EmberCrossfilter Class

Methods

_applyContentChanges Updates the content array based on the applied filters. Any changes to the Crossfilter should mean invoke this function!

() Void private

Returns:

Void:

_createCrossfilter Creates the Crossfilter from the content.

() Boolean private

Returns:

Boolean:

_createDimensions Create the defined dimensions from the controller.

() Void private

Returns:

Void:

_createFilterBoolean

(
  • map
)
private

Parameters:

  • map Object

    Responsible for setting up the filterAnd/filterOr methods by attaching a bitwise operator to each model.

_setFilterBoolean

(
  • map
  • dimension!~YUIDOC_LINE~!Implement
)
Void private

Parameters:

  • map Object
  • dimension!~YUIDOC_LINE~!Implement Object

    a missing Crossfilter method for checking the inArray, although if you have a small array, then you might be better off using bitwise against the filterFunction method.

Returns:

Void:

_setFilterFunction

(
  • map
  • dimension!~YUIDOC_LINE~!Although
)
private

Parameters:

  • map Object
  • dimension!~YUIDOC_LINE~!Although Object

    the filterFunction is similar to filterRange, filterExact, etc... we need to invoke a user callback in order to calculate it. For this we use convention over configuration.

_setFilterRangeMax

(
  • map
  • dimension!~YUIDOC_LINE~!Checks
)
private

Parameters:

  • map Object
  • dimension!~YUIDOC_LINE~!Checks Object

    the corresponding dimension for the maximum value, and then continues to create the array for the filterRange.

_setFilterRangeMin

(
  • map
  • dimension!~YUIDOC_LINE~!Checks
)
private

Parameters:

  • map Object
  • dimension!~YUIDOC_LINE~!Checks Object

    the corresponding dimension for the minimum value, and then continues to create the array for the filterRange.

_sortedContent

(
  • content
  • property
  • isAscending
)
String private

Parameters:

  • content Array
  • property String
  • isAscending Boolean

Returns:

String:

_topBottom

(
  • key
  • count
  • crossfilterMethod
)
Number | String private

Parameters:

  • key String
  • count Number
  • crossfilterMethod String

Returns:

Number | String:

addFilter

(
  • key
  • value!~YUIDOC_LINE~!Applies
)
Void

Parameters:

  • key Object
  • value!~YUIDOC_LINE~!Applies Object

    a filter to one of our pre-defined dimensions.

Returns:

Void:

addRecord

(
  • record
)
Boolean

Parameters:

  • record Object

    Adds a record to the Crossfilter.

Returns:

Boolean:

addRecords

(
  • records
)
Number

Parameters:

  • records Array

    Wrapper method for adding many records to the Crossfilter.

Returns:

Number:

bottom Helper method to find the lowest value.

(
  • property
  • count
)
Number | String

Parameters:

  • property String
  • count Number

Returns:

Number | String:

clearAllFilters Clears all of the filters that are currently active.

() Void

Returns:

Void:

defineProperty Wrapper for the Object.defineProperty, as all of our defined dimensions will be similar in their construction.

(
  • name
  • property
)
Void

Parameters:

  • name Object
  • property Object

Returns:

Void:

deleteRecord

(
  • record
)
Boolean

Parameters:

  • record Object

    Deletes a record from the Crossfilter.

Returns:

Boolean:

deleteRecords

(
  • records
)
Number

Parameters:

  • records Array

    Wrapper method for deleting items from the Crossfilter.

Returns:

Number:

getBooleanType

(
  • map
)
String

Parameters:

  • map Object

Returns:

String:

init Invoked when the controller is instantiated.

()

isBooleanFilter

(
  • map
)
Boolean

Parameters:

  • map Object

Returns:

Boolean:

removeFilter

(
  • key
  • value!~YUIDOC_LINE~!Clear
)
Void

Parameters:

  • key Object
  • value!~YUIDOC_LINE~!Clear Object

    the any applied filters to the dimension.

Returns:

Void:

sortContent Sorts the content based on the property, and whether it should be ascending/descending.

(
  • property
  • isAscending
)
Void

Parameters:

  • property String
  • isAscending Boolean

Returns:

Void:

top Helper method to find the highest value.

(
  • property
  • count
)
Number | String

Parameters:

  • property String
  • count Number

Returns:

Number | String:

Properties

_crossfilter

Object private

_deletedModels

Array Holds a list of models that have been deleted. private

allowTiming

Boolean Can be overridden by the class to allow for timing details to be output.