I think you are talking about paginal outpout on client. You need to do a quest synchronously. The following code snippet may give you some ideas.
function getEmployeeData(grid) {
var responseT={};
var req = (window.XMLHttpRequest)?new XMLHttpRequest()

(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):false);
if(req){
var pageInfo = grid.getPageInfo();
req.open("GET", "Controller.php?pageNum=" + pageInfo.pageNum, false);//the third param must be false
req.send(null);
var json=eval(req.responseText);
...
}
}