ngReactGrid icon indicating copy to clipboard operation
ngReactGrid copied to clipboard

Add a way to override the default sort

Open pmq opened this issue 11 years ago • 4 comments

Hi Jose,

First of all, thanks for ngReactGrid, it works well. We needed a way to be able to specify our custom sort on some columns, hence this first draft. Before we go further on this (the current PR is crude), just wanted to know your opinion on this feature. Would there be enough interest to warrant merging at some point?

Thanks.

pmq avatar Nov 16 '14 21:11 pmq

@pmq sounds interesting, definitely interested in merging this functionality.

josebalius avatar Nov 16 '14 22:11 josebalius

@pmq is this complete? or still waiting to submit more?

josebalius avatar Nov 18 '14 22:11 josebalius

@josebalius I'm waiting to push this into production for us, and see if the users complain :) It should only be a few days.

Two questions though, to adapt the PR :

  1. right now I've put the sort function in sortInfo, maybe this should go top-level, just like ngGrid used to do with sortFn?
  2. in your original object comparison code, you have two possible return values (1 and -1), but not 0 to denote equality; should I do the same (right now I return 0 in case the two objects are equal)?

pmq avatar Nov 18 '14 22:11 pmq

@josebalius I didn't forget this PR - right now we're running this and it seems OK. The two questions still stand, but if you want to review as-is, it's also fine for me. Let me know!

pmq avatar Nov 30 '14 17:11 pmq