How To Refresh Cgridview With Criteria From External Fields?

I have a form that works as a search form, with various criteria fields. The search takes place when the user clicks on the Search button. I would like to have a CGridView object to display the results. At the moment, I use jQuery to send a AJAX request with the values from all criteria fields and put the result (html output) inside an element. I would like to replace this functionality with CGridView.

How can I click on the button and refresh the data of the grid view using the criteria fields? I suppose I must write JS code to do some stuff…