I have some problem with paging at grid with remote filtering.

Grid has 1000 records.
Page size is 100.
User moves to page number 2.
User applies some external (not grid member) filter.
User press refresh button at paging bar.
Store applies filter data by code
PHP Code:
listeners:{    beforeLoad: function (store){            
store.getProxy().extraParams.query Ext.ComponentManager.get("vendorfilter").value;   
Server-side script build new query and generate response with 56 records.
But page is 2, There is no page 2 now!
Well, server can send empty page or last page.
If server send empty recordset, paging bar is disabled.
If server send last page, paging bar looks funny
"page 7 from 1" and "Displaying 101-56 of 56"