FLUID-4047: Extend column sorting to allow per-column callbacks

Metadata

Source
FLUID-4047
Type
Improvement
Priority
Major
Status
Open
Resolution
N/A
Assignee
N/A
Reporter
Eric Dalquist
Created
2011-02-01T12:09:21.925-0500
Updated
2011-10-17T09:30:25.656-0400
Versions
  1. 1.4
Fixed Versions
N/A
Component
  1. Pager

Description

Extend the built-in sorting method of the fluid pager to allow columnDefs to provider either a custom comparator or a custom value extractor to use when sorting.

Comments

  • Eric Dalquist commented 2011-02-01T12:11:09.286-0500

    New default sorting function along with a default sorting callback impl and two example value extractors for dates and numbers.

    This would be used like:
    columnDefs: [
    {key: "date", valuebinding: "*.date", sortable: true, sortValueExtractor : dateExtractor},
    {key: "status", valuebinding: "*.status", sortable: true, sortFunction: hrs.pager.statusComparator},
    {key: "total", valuebinding: "*.total", sortable: true, sortValueExtractor : hrs.pager.currencyExtractor},
    {key: "type", valuebinding: "*.type", sortable: true},
    {key: "title", valuebinding: "*.title", sortable: true}
    ]