PDA

View Full Version : Layout dialog visual problem



galdaka
21 Feb 2007, 2:23 AM
I am working in a component that allows to choose values to the user. I am working with version 0.40 although with the 0,33 also it fails. It is a visual aspect, when I choose “multiple=true” and must paint east region appears to me a rare thing in the North part. With FireFox works fine but with IE 6 it fails. Any idea?

HTML:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="YUI-EXT/SVN/css/yui-ext.css" rel="stylesheet" type="text/css" title="estilos">
<script src="YUI-EXT/My YUI-EXT/js/utilities_2.1.0.js" type="text/javascript"></script>
<script src="YUI-EXT/SVN/yui-ext.js" type="text/javascript"></script>
<script src="selectInfo.js" type="text/javascript"></script>
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<script>
var a = new Array(1 ,2 , 3);
var ct1 = "1, 2, 3,1, 2, 3,1, 2, 3,1, 2, 3,1, 2, 3,1, 2, 3,1, 2, 3";
var ct2 = "1; 2; 3";

var pp2 = new DominoUISelectInfo({
list : a,
modal : true,
multiple: false,
title: 'Hola chatina!'
});

var pp3 = new DominoUISelectInfo({
text : ct1,
separator: ',',
multiple: true,
modal : true
});





</script>
<input type="button" value="Ver 2" onclick="pp2.show()" />
<input type="button" value="Ocultar 2" onclick="pp2.hide()" />
<input type="button" value="Ver 3" onclick="pp3.show()" />
<input type="button" value="Ocultar 3" onclick="pp3.hide()" />
</body>
</html>

JAVASCRIPT COMPONENT (selectInfo.js)


DominoUISelectInfo = function(config) {
YAHOO.ext.util.Config.apply(this,config);
this.init();
};

DominoUISelectInfo.prototype.init = function() {
this.createDialog();
this.recoveryData();
};

DominoUISelectInfo.prototype.createDialog = function(){
if(!this.selectInfo){
this.ramdonID = new Date().getTime().toString();
var divContainer = YAHOO.ext.DomHelper.append(document.body, {tag: 'div', id: 'COM52_' + this.ramdonID});
YAHOO.ext.DomHelper.append(divContainer, {tag: 'div', cls: 'ydlg-hd', html: this.title ? this.title : ''});
var divBody = YAHOO.ext.DomHelper.append(divContainer, {tag: 'div', cls: 'ydlg-body'});
YAHOO.ext.DomHelper.append(divBody, {tag: 'div', id: 'east_' + this.ramdonID, cls: 'ylayout-inactive-content'});
YAHOO.ext.DomHelper.append(divBody, {tag: 'div', id: 'center_' + this.ramdonID, cls: 'ylayout-inactive-content'});
this.selectInfo = new YAHOO.ext.LayoutDialog('COM52_' + this.ramdonID, {
modal: this.modal ? this.modal : false,
width: this.width ? this.width : 600,
height: this.height ? this.height : 400,
shadow: this.shadow ? this.shadow : true,
minWidth: this.minWidth ? this.minWidth : 200,
minHeight: this.minHeight ? this.minHeight : 200,
east: {
split:true,
initialSize: 150,
minSize: 150,
maxSize: 250,
titlebar : false,
alwaysShowTabs: false
},
center: {
split:true,
titlebar : false,
autoScroll:true
}
});
this.selectInfo.addKeyListener(27, this.selectInfo.hide, this.selectInfo);
this.selectInfo.addButton('Cancelar', this.selectInfo.hide, this.selectInfo);
this.selectInfo.addButton('Aceptar', this.selectInfo.hide, this.selectInfo);
}
};

DominoUISelectInfo.prototype.recoveryData = function(){
if (this.list){
this.createDataGrid(this.list);
}else{
if (this.text){
this.createDataGrid(this.text.split(this.separator));
}else{
alert("error");
}
}
};

DominoUISelectInfo.prototype.createDataGrid = function(o) {
var myData = [];
for(i=0;i<o.length;i++){myData[myData.length] = [o[i]];}
var dataModel = new YAHOO.ext.grid.DefaultDataModel(myData);
var colModel = new YAHOO.ext.grid.DefaultColumnModel([{header: ""}]);
selectionModel = new YAHOO.ext.grid.EditorAndSelectionModel();
var grid = new YAHOO.ext.grid.Grid('center_' + this.ramdonID, dataModel, colModel, selectionModel);
grid.trackMouseOver = true;
grid.render();
var layout = this.selectInfo.getLayout();
this.selectInfo.beginUpdate();
layout.add('center' , new YAHOO.ext.GridPanel(grid, {title: 'Usuarios seleccionados'}));
if (this.multiple) layout.add('east', new YAHOO.ext.ContentPanel('east_' + this.ramdonID, {title: 'Selección'}));
this.selectInfo.endUpdate();
};

DominoUISelectInfo.prototype.falloCrearDeVista = function(o) {
alert(o.text);
};

DominoUISelectInfo.prototype.show = function(){
this.selectInfo.show();
};

DominoUISelectInfo.prototype.hide = function(){
this.selectInfo.hide();
};

petbo2
12 Mar 2007, 5:05 AM
var grid = new YAHOO.ext.grid.Grid('center_' + this.ramdonID, dataModel, colModel, selectionModel);

Did you misspell random?