Allow "no sorted" Icons & add class for sorted columns & allows to cancel unfinished request #253
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are three useful changes, hope you can join them to the next version or at least use as an idea:
Allow "no sorted" Icons
Allows to optional add a "no sorted" icon, im not sure what icon library u use but in my case i add a double (up and down) chevron icon when the column is not sorted so its more clear for the user that they can sort by clicking the title
Add class for sorted columns
Useful to add some kind of class for sorted columns so you can add styles for "sorted" columns and make more clear that the content is ordered by this columns
Cancel unfinished request when new request was sended (My favorite, please add this)
If the user quickly order a row many times, and have an unfinished request sometimes multiple "loadData" request was sended, this use much memory and in some cases the oldest request finish last so the current data is innacurate, this is more problematic with custom filters like a search input where the user type and the data was live refreshed. With this changes if the loadData funcion has a previous unfinished request it cancel it so you only have one request at a time.
PD: Sorry for the "testing" commit