TreeGrid Caching in IE 8 on 'Back'

Hello,

I have a page that loads a TreeGrid with default values when the page is first requested. It is then possible for the user to make a selection from a Select that will load a new set of values into the grid. This works great.

If a user clicks on a link in the grid and then clicks the Back button in their browser, the original (default) values are displayed in the TreeGrid. This is not a problem with FF, only IE.

To fix the problem in FF I adjusted my ajax to update the value of the hidden input whenever an ajax request is made.

In IE this hidden input does have the desired (new) value even after clicking on the back button, but the grid displays the original data for some reason.

I have tried putting mygrid.preventIECaching(true); both before and after mygrid.init(), but with no success.

My code is below. Any help would be appreciated.

[code]mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.selMultiRows = true;
mygrid.imgURL = contextPath+"/include/dhtmlx/codebase/imgs/icons_greenfolders/";
mygrid.setHeader(“Category > Sub Category > Course,Course Description,Version,Preview,Inactivate”);
mygrid.attachHeader("#text_filter, , , , ");
mygrid.setInitWidths(“270,*,60,55,65”);
mygrid.setColAlign(“left,left,center,center,center”);
mygrid.setColTypes(“tree,ro,ro,img,img”);
mygrid.setColSorting(“str,str,int”);
mygrid.enableSmartRendering(1);
mygrid.preventIECaching(true);
mygrid.init();
mygrid.enableAutoHeight(true, “500”);
mygrid.enableDistributedParsing(true, 10, 500);
alert(“Happening.”);
mygrid.setSkin(“dhx_skyblue”);
mygrid.loadXMLString(document.getElementById(“catalogXML”).value);
mygrid.enableTreeCellEdit(false);
mygrid.expandAll(true);

			$.subscribe('before', function(event,data) {
		    });
		    $.subscribe('complete', function(event,data) {;
		     	if (document.getElementById('errorsExist') == null){
			     	var newXml = document.getElementById("ajax_catalogXML");
		     		mygrid.clearAll();
			     	mygrid.loadXMLString(newXml.value);
			    	mygrid.expandAll(true);
			    	document.getElementById('catalogXML').value = newXml.value;
		     	}
		    });
		    $.subscribe('errorState', function(event,data) {
		        alert('status: ' + event.originalEvent.status + '\n\nrequest status: ' +event.originalEvent.request.status);
		    });[/code]

Well, if I execute the following statements in the address bar of IE then the correct data is displayed.

javascript:mygrid.clearAll();
javascript:mygrid.loadXMLString(document.getElementById('catalogXML').value);

Solved.

Moved the mygrid.init() and the code following it to a window.onload call. See below:

		<script type="text/javascript">
			window.onload = function(){
				mygrid.init();
				mygrid.enableAutoHeight(true, "500");
				mygrid.enableDistributedParsing(true, 10, 500);
				mygrid.setSkin("dhx_skyblue");
				mygrid.loadXMLString(document.getElementById("catalogXML").value);
				mygrid.enableTreeCellEdit(false);
				mygrid.expandAll(true);
			};
		</script>