PDA

View Full Version : Is it a bug? The grid column title shows {1} in dialog in IE



davy_wei
8 Jan 2007, 6:25 AM
Hi,

I don't know if it is a YUI-ext bug.

I created a dialog which contains one GridPanel. It shows {1} for all the column title in IE. However, it works properly in Firefox. Anyone knows why?

The debugging page is http://www.yr-tech.com:8024/useradmin.php?act=new
You will see the problem in IE when click "Select" right after the magnifier icon. The problem only occurs in IE. I tried in Opera and Firefox, and both of them works find.

My code of loading the dialog is


var SelectCompany = function(){
var dialog, showBtn;
return {
init: function(){
showBtn=getEl('select_company');
showBtn.on('click',this.showDialog,this,true);
},
hideDialog: function(){
dialog.hide();
},
showDialog: function(){
if(!dialog){
dialog=new YAHOO.ext.LayoutDialog("dialog_company", {
modal:true,
width:480,
height:380,
shadow:true,
minWidth:300,
minHeight:300,
center:{
autoScroll:true
}
});
dialog.addKeyListener(27,dialog.hide,dialog);
dialog.addButton('Close',this.hideDialog,dialog);

var layout=dialog.getLayout();
var grid, dm, cm, sm;
sm=new YAHOO.ext.grid.DefaultSelectionModel();
cm=new YAHOO.ext.grid.DefaultColumnModel([
{header:"Company Name",width:200},
{header:"Company City",width:150},
{header:"Country",width:100}
]);
cm.defaultSortable=true;
dm=new YAHOO.ext.grid.XMLDataModel({
tagName:'Company',
totalTag:'TotalCount',
id:'id',
fields:['CompanyName','CompanyCity','CompanyCountry']
});
dm.initPaging('/compadmin.php',10);
dm.baseParams={'act':'page'};
dm.setDefaultSort(cm,0,'ASC');
dm.addListener('load',sm.selectFirstRow,sm,true);

grid=new YAHOO.ext.grid.Grid('company_panel',dm,cm,sm);
grid.render();
dm.loadPage(1);

dialog.beginUpdate();
layout.add('center',new YAHOO.ext.GridPanel(grid,{fitToFrame:true}));
dialog.endUpdate();
}
dialog.show(showBtn.dom);
}
};
}();

YAHOO.ext.EventManager.onDocumentReady(SelectCompany.init,SelectCompany,true);

hcristea
8 Jan 2007, 7:17 AM
Hello,

i'm having the same problem in IE.

I have something similar: a GridPanel and a BasicDialog. From what i saw, the column headers in the Grid becomes {1} when i add a button to the dialog.

Try commenting this line in your code and see if the column headers are affected:


dialog.addButton('Close',this.hideDialog,dialog);

I dont know if its a bug or i'm missing something but i had to make a compromise and move the button from the BasicDialog inide the dialog.

davy_wei
8 Jan 2007, 7:35 AM
Yes, after I commenting this line, the problem is gone in IE.

I am pretty sure it's a bug in IE(I tried in 6.0 & 7.0).