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

Show ajax processing #655

Closed
lindonb opened this issue Jun 21, 2014 · 2 comments
Closed

Show ajax processing #655

lindonb opened this issue Jun 21, 2014 · 2 comments

Comments

@lindonb
Copy link

lindonb commented Jun 21, 2014

This is a wish: would it be worthwhile to add the ability to show ajax processing? For example, I have extra code that reduces the opacity of the table rows whenever ajax is processing rows due to filterStart, sortStart or pageMoved:

$('table tr td').css('opacity', 0.25);

Upon ajaxComplete, then the opacity is set back to 1. Such formatting could be hardcoded to occur if the appropriate option is select or somehow give admins the ability to customize the formatting effect desired.

@Mottie
Copy link
Owner

Mottie commented Jun 21, 2014

Hi @lindonb!

As it stands right now, a tablesorter-processing class name is added to the headers when the showProcessing option is set to true. This is actually set up to occur 500 ms after the start of the process to prevent the processing icon flashing on the screen. It's probably a moot point for sorting though since javascript is single threaded and 500 milliseconds in, it'll be chugging away and ignoring anything else; but it should work fine for asynchronous processes.

Also, If only one header is being targeted (sorting or filtering), then only that header will show an indicator. And that can be modified by css (here is the blue theme specific code).

I guess I could also add a class name to the table so you can apply whatever other styling you desire.

If you want to use scripting, then you can bind to the sortBegin and sortEnd events and do whatever, or just replace the $.tablesorter.isProcessing function.

@lindonb
Copy link
Author

lindonb commented Jun 21, 2014

That did it! Another block of code I can get rid of - thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants