PDA

View Full Version : Can't adjust text width to Panel, and set it scrollable



ci11111
27 Mar 2012, 12:50 AM
I have a panel


{
id: 'detailPanel',
styleHtmlContent: true,
region: 'center',
//bodyPadding: 7,
//bodyStyle: "background: #ffffff;",



filled from a template


var details = Ext.create('Ext.XTemplate', [
'<div>',
//...
'</div>'
]
);



resultList.getSelectionModel().on('selectionchange', function(sm, selectedRecord) {
if (selectedRecord.length) {
var detailPanel = Ext.getCmp('detailPanel');
var record = selectedRecord[0];
//...
details.overwrite(detailPanel.body, record.data);
}
});


I would like to fit text to the panel width, and not having to scroll horizontally , how can I do that please?

mitchellsimoens
27 Mar 2012, 10:21 AM
You should be able to wrap the overflow and size the <div> to fit within the panel. Personally I would set the tpl config on the panel and simply execute update on the panel and that will take that data array/object and apply it to the tpl and update the html of the panel.

ci11111
27 Mar 2012, 11:50 PM
wow I did this, on the text, before inserting it:


.replace(/ /g,'&nbsp;')

and that's what prevented to go to the line,

when this instruction is removed it goes fine