Mottie / tablesorter

Github fork of Christian Bach's tablesorter plugin + awesomeness ~

Home Page:https://mottie.github.io/tablesorter/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filter widget: callback function / event when started/completed

oozrafa opened this issue · comments

An event is needed for the filter widget so that functions can be passed when the filter starts and when it ends.

Two examples of uses of this:

  1. To show a spinner when filtering because it can take some time on very large tables.
  2. I have a 'total' table foot and would like to update it accordingly - ie, recaculate the total for rows which are visible (match the filtered values).

I'm doing a lot of work to the filter widget, and I have already included a filterEnd callback. But I haven't added a filterStart event yet. What do you plan on passing to the filter widget? Or will the information be modified?

I also have implemented a method to trigger a search. Maybe this would work better instead of a filterStart callback?

My 2 current use cases are as follows:

  1. I have a very large table (10,000 rows) and filtering a column can take some time. To the user it seems as if nothing is happening, or that the page is stuck. So when the filter starts I'd like to show a notification that something is happening, and remove the notification when the filtering has completed. So for me it's not really passing anything to the filter widget, but know when it starts and when it finishes.
  2. I have a table when one of the columns has a number in each row, and at the bottom of the table I have a table foot with the total for that column. I need to be able to run a function when the filtering is complete in order to update the 'total' cell with new total for only the visible rows. So here I don't really care when it starts, but only when it finishes.

Actually, since I'm already working on the filter widget, I'll do both - add the "processing icon" and the callbacks :)

In the next update, I've been trying to improve the speed of the filter widget, so hopefully it will speed up a bit for you :)

wow, great! Really good job!

Ah great, I'll be needing the filterEnd callback too. Really like your project!

idea for pager look/layout, http://zoggy.net/pager-ex1.png

Version 2.4 now has filterInit, filterStart and filterEnd events. See the docs on how to use them.

I've also added a processing icon - I'm not happy with it since it doesn't seem to animate the icon, but it works - using these events. You can enable it using the new showProcessing option.