Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort on visible text (may contain a text from other model), not the actual value of the column (field) #5956

Closed
5 tasks done
hchinthapally opened this issue Jan 19, 2017 · 3 comments

Comments

@hchinthapally
Copy link

hchinthapally commented Jan 19, 2017

Please make sure each of the following is true before submitting a new issue. We are a small team with limited time and it is very difficult to manage issues if they aren't reported correctly.

  • This is a bug report, not a question on how to use the grid.
    Use Stack Overflow or Gitter for questions.
  • You have searched the open issues to see if this bug has been filed before. We don't want duplicate issues.
  • You have reviewed the tutorials and documentation to ensure you are using the grid correctly. ui-grid.info
  • You are using the latest version of the grid. Older versions are not patched or supported.
  • You have provided steps to recreate your bug. A plunkr is even better.
@hchinthapally
Copy link
Author

Can anyone help me to sort on visible text (contains text from different model), and not the actual value of the column(field). Actual value of the column is used for filtering the column.

@jniles
Copy link

jniles commented Jan 21, 2017

@hchinthapally, if you could include an example or plunkr it would help your questions get answered faster.

You have two options:

  1. Create your own custom sorting algorithm via the sortingAlgorithm property on the column definition. See the sortingAlgorithm documentation.
  2. If you are using a filter to transform the data, just set the sortCellFiltered property to true.

Hope this helps!

@hchinthapally
Copy link
Author

Hi Niles,

Thank you so much for responding.

Here is the plunkr: http://plnkr.co/edit/Za1sgfiK6cJmeFHPdI8E?p=preview .

I am having scores and levels associated with scores, for the list of students.
While displaying scores, I am filtering the column by levels, which is working good.

But, sorting is sorting based on levels and not the actual text.

User scenario: Want to filter by a level and then sort the column by score.

Please help me out!!

Thanks again!

@mportuga mportuga closed this as completed Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants