leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
537 stars 215 forks source link

How can I have a spinner when the search is loading in wice_grid ? #208

Closed ddpdevang closed 9 years ago

ddpdevang commented 9 years ago

I want to have a spinner when the search results are filtered.

ANy idea how to do it dynamically using jquery

leikind commented 9 years ago

Filters cause page reloads, how can you have a spinner while the page is being reloaded?

ddpdevang commented 9 years ago

One of the method that will work statically for sure is below:

on "submit" action of the filters, a jquery function will be written which clears the grid element and the spinner function from the below example is called on next line...

http://stackoverflow.com/questions/1509044/showing-a-spinner-during-an-ajax-request

ddpdevang commented 9 years ago

Only thing I am concerned is as the library is dynamic and handles everything, it should also show that the search is being performed, while the user is waiting for the results...

What actually happens is the form id changes for different form and also the control id changes for different form... so better if the thing is handled dynamically...

It is just a small thing... will make the library more better and polished to use

leikind commented 9 years ago

http://stackoverflow.com/questions/1509044/showing-a-spinner-during-an-ajax-request

What does an AJAX request have to do with a page reload?

All that WiceGrid needs to do is to emit a custom event when a filter action starts to be processed, and the client code can intercept it and .show() whatever hidden gif there is.