PDA

View Full Version : DataGrid inside <table>: column resize problem : IE6



Vitaliy Shevchuk
13 Jul 2007, 4:58 AM
Hi,

I have noticed that in IE6 datagrid column resize does not work very well if the dataGrid is inside <table>

to reproduce the issue, you can add "<table><tr><td>" just after the <body> in examples/grid/edit-grid.html

967

Thanks.
Vitaliy

jack.slocum
14 Jul 2007, 8:15 AM
This is a known issue with no known workaround. It is a bug in IE.

sjivan
24 Jul 2007, 3:41 AM
This thread : http://extjs.com/forum/showthread.php?t=2613 has a kamikaze workaround that works for me.

Basically add the following code to your Grid's column resize event handler if Ext.isIE.



var view = grid.getView();
view.refresh();
view.updateHeaders();
view.updateColumns();
view.updateSplitters();
view.updateHeaderSortState();
view.renderPhase2.defer(1, grid);


Sanjiv

bob.chesley@nhsoftwerks.com
24 Jul 2009, 11:06 AM
After frustration with <cfset AjaxOnLoad('ieGridFix')> I found that there is another approach that will get IE to handle this issue. My cfgrid's are inside tables as the site template is built that way and not going to be changed (although I also found no happiness outside of an html table in IE7).

Here's the code:
// function to render the grid after user resizes a column
<script type="text/javascript">
ieGridFix = function(){
//get the grid component
grid = ColdFusion.Grid.getGridObject("msdsGrid");
//Fires when a column is resized by the user
grid.addListener("columnresize", function(){ColdFusion.Grid.getGridObject("msdsGrid").render()});
}
</script>

Rather than AjaxOnLoad which appears to lead to script placement problems with the built in CF/Ext calls (i.e., ieGridFix 'undefined' errors) just call the underlying script directly as in:
<script type="text/javascript">
if (Ext.isIE == true) {
//alert('running IE');
ColdFusion.Event.registerOnLoad(ieGridFix,null,false,true);
}
</script>

Only do so for IE browser types.

Bob
:)