[eluser]jwindhorst[/eluser]
Perhaps you're taking a difficult approach to a relative simple problem. You are trying to deal with redirects in order to update an element of the page. That is, assuming I interpreted the problem correctly.
Assuming you are using jquery somewhere, why not put the grid in it's own file and use jquery to lazy load it via Ajax. Then you already have the code:
Code:
// opening javascript tag here //
$(document).ready(function(){
$('#grid-wrapper').post("my_grid.php", function(data) {
alert("Data Loaded: " + data);
// NOW SET IT INTO THE HTML FUNCTION OF YOUR WRAPPER ELEMENT.
// THIS ESSENTIALLY "REFRESHES" THAT ELEMENT FOR YOU.
$('#grid-wrapper').html(data);
};
})
// closing javascript tag here //
NOTE: You should include your CSS files before your Javascript files. If you have slow loading libraries in your JS there are other ways to handle that, but at least your styles will be loaded and your page can appear proper even if a slow loading library is slowing execution.
NOTE: It may rub some truists in the MVC communities, I still find it much easier to create the HTML in the Ajax controller. I've often used an Ajax_controller.php to routes ajax calls, in tandem with a views/ajax/view_name.php to manage these calls. These ajax view files would never include a views/header.php file or an <html> tag, it is merely a section of a page expected to be loaded into a full html document.
I definitely find it easy to group these together in a controller called lazy_partials, or lpartials is advantages. It allows you to set specific security restrictions on these requests. Just to keep things clean I then like to create a views/lpartials directory to hold these lazy loaded elements. Snippets is likely a more PC term but I learned it as lazy loading so that's what I call it.