PDA

View Full Version : Pb showing a window with Header above urlbar



ci11111
29 Mar 2012, 1:29 AM
I'm getting this problem, using this function

It could be solved if it was possible to manage the maxHeight of the window, or using a Tpl, as I'm using record.get('text') as argument, using a store, but using a tpl, I don't know how to link it to a specific store item



function showText(text){
return Ext.create('Ext.window.Window', {
title:'Testo:',
autoShow: true,
collapsible: true,
animCollapse: true,
maximizable: true,
autoScroll: true,
width: 750,
maxHeight: 500,
items: {
xtype: 'panel',
layout: 'fit',
maxHeight: 500,
styleHtmlContent: true,
html: text
}
});
}




33293



Edit:

doing like this:


function showText(text){ return w = Ext.create('Ext.window.Window', {
title:'Testo:',
autoShow: true,
collapsible: true,
animCollapse: true,
maximizable: true,
width: 750,
maxHeight: 500,
items: {
xtype: 'panel',
layout: 'fit',
autoScroll: true,
maxHeight: 500,
styleHtmlContent: true,
html: text

},
listeners: {
show: function(){
this.setPosition(10,10);
this.down('panel').setHeight(400);
}
}
});
}
but I can't believe this is the right way

I would really like something using



xtype: 'panel', // or 'dataview'?
tpl: {text}


and set window.down('panel').setRecord(record.get('text')); after, but this functions are not existing

mitchellsimoens
29 Mar 2012, 7:25 AM
You need to think Ext JS 4, there are differences between Ext JS 4 and Sencha Touch 2 (knowing you were working with ST2 before this).

If you are using the tpl config then you can either use the data config if you have hte data when you are creating the panel or using the update method to apply the array/object on to the tpl. You won't be able to set a record onto it, you can set the record.data using the update method.

ci11111
29 Mar 2012, 7:55 AM
ah finally working like that w.down('panel').update(record.data);

<tpl else> or <tpl elseif="..."> not working in ExtJS 4.07, do you know if it will be working in 4.1?

mitchellsimoens
29 Mar 2012, 7:59 AM
Should be in 4.1.0