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

add sort order to onSort function arguments #1332

Merged
merged 1 commit into from Oct 27, 2015

Conversation

SergioCrisostomo
Copy link
Member

@SergioCrisostomo SergioCrisostomo commented Oct 26, 2015

When sorting a table the onSort function does not tell which direction the sort happens.
Following @oskarkrawczyk 's work I made this PR to fix that.

This would make possible to know if if the reversed state is true or false.

fixes #1193

@@ -40,7 +40,7 @@ HtmlTable Method: constructor

### Events

* sort - callback executed when a column is sorted; passed the *tbody* and the index of the column sorted.
* sort - callback executed when a column is sorted; passed the *tbody*, the index of the column sorted and *reversed* to know the sorting direction.
Copy link
Member

@anutron anutron Oct 27, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't super clear. I'd do:

sort - callback executed when a column is sorted; passed the *tbody* (Element), the index of the column sorted (Integer) and which direction the table is sorted ("asc" or "desc").

Copy link
Member Author

@SergioCrisostomo SergioCrisostomo Oct 27, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 will do

SergioCrisostomo added a commit that referenced this pull request Oct 27, 2015
add sort order to onSort function arguments
@SergioCrisostomo SergioCrisostomo merged commit c6a90c3 into mootools:master Oct 27, 2015
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

Successfully merging this pull request may close these issues.

Sorting direction as the third argument in onSort
2 participants