Smart-Table icon indicating copy to clipboard operation
Smart-Table copied to clipboard

Use Multiple levels sort using st-sort directive

Open opeled opened this issue 12 years ago • 2 comments

Multiple sort predicates cannot be currently used.

In case the stSort directive will also allow an array of functions (and not only check that 'ng.isFunction(getter(scope)'), then multiple level sort can be used.

opeled avatar Dec 01 '14 16:12 opeled

I don't know what you exactly mean by multiple levels. If it is the ability to pass as predicate ** for a given column ** a string, either a function, either an array of function (like the signature of angularjs orderBy filter) then it can be easy. If it is combine sort from different column then it is trickier:

  • how to define the priority ?
  • how to know when to combine them or when to reset the others ?
  • what about the style class to apply
  • etc

lorenzofox3 avatar Dec 05 '14 13:12 lorenzofox3

http://ui-grid.info/ supports ordering by multiple columns, so we can learn some lessons from that?

What would the backend code look like to sort by multiple columns? In my use case, I always want inactive columns to appear last regardless of what the user is sorting or filtering by. Is that possible?

aidanlister avatar Mar 03 '15 11:03 aidanlister