0

Grid-GridCell-Text issues :-C

Helo,


I need help about visualization in a Grid. My problem:

I'm develop a "chat" widget. I use a Grid to show the conversation (Each phrase of a contact --> One GridCell with text and image inside).

When a contact write more than one line of text, I activate the wrap:true at textElement and the height of the gridCell enough to show it.
The problem is:
The next gridCell that cellCreator ( or cellupdate update) when a contact write, is created under the last gridcell(last phrase), like it heigth was only of one line.

I try to find it in forums, without hit.
When I create the Grid, "row" property is defined. It's posible that this property define the heigth of the GridCell and I can't change after it?

I need to use Grid because I show receive files (images) and text. There is another way to improve/make it?


Thanks


CODE
//grid para el texto del chat
this.controls.chatGrid = new KONtx.control.Grid({
focus: false,
columns: 1,
rows: this.config.visibleRows,
carousel: true,
cellCreator: this.cellCreator,
cellUpdater: this.cellUpdater,
styles: {
....
},
}).appendTo(this).attachAccessories(this.controls.pageIndicator);

cellCreator: function() {
var cell = new KONtx.control.GridCell({
styles: {
height: this.height,
width: this.width,
},
events: {
onSelect: function(event) {
.......
}
}
});
cell.text = new KONtx.element.Text({
wrap: true,
//truncation: 'none',
styles: {
width: KONtx.utility.scale(300),
color: '#000000',
fontSize: this.config.fontsize,
hAlign: 'left',
vAlign: 'center'
}
}).appendTo(cell);
cell.image=new KONtx.element.Image({
styles:{
vALign: "center",
hAlign: "right",
height: KONtx.utility.scale(20),
width: KONtx.utility.scale(20),
}
}).appendTo(cell);
//cell.heigth = cell.text.height;
return cell;
},

//actualizador de las celdas
cellUpdater: function(cell, dataitem) {

log("CHAT: cellupdater vale: "+dataitem);
cell.text.setText(dataitem.text);
if(dataitem.filename){
log("CHAT: HEMOS RECIBIDO UN ARCHIVO: nombre "+ dataitem.filename +", url " +dataitem.url );
cell.image.src = 'Images/file.png';
}
cell.height = cell.text.height;

},

by
0 Replies

Recent Posts

in General - Yahoo! TV Widgets