trying to implement a search from many databases, and sometimes these queries are slow. How can I force to have a wait message and to not allow result windows with grid until search completes?

current skeleton:

var win = new Window();

should I try to cover the whole lot into a ajax call?
It was not working, because after slow query, it is doing a "paging": localhost:8080/search.json?start=0&limit=25, and worst part is, it made automatically, and not including my required criteria=value parameter.
Any hints where this paging coming from? (not added paging at all)