PDA

View Full Version : Wrap up the text in combo box option



vinaykumar2
8 Aug 2010, 11:14 PM
the length of the option of combo box is very long.I want to wrap up the text.Can anyone suggest how can i achieve this.

Condor
8 Aug 2010, 11:36 PM
Example:

<style type="text/css">
.my-class {
white-space: normal;
}
</style>
<script type="text/javascript">
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = 'resources/images/default/s.gif';

new Ext.Viewport({
layout: 'form',
items: [{
xtype: 'combo',
store: ['Item 1', 'A very very very very very very very very very very very long item', 'Item 3'],
fieldLabel: 'Combo',
tpl: '<tpl for="."><div class="x-combo-list-item my-class">{field1}</div></tpl>'
}]
});
});
</script>

vinaykumar2
8 Aug 2010, 11:52 PM
thanks for replying.actually in my application i need to transform the extjs combo box to select html tag.can you give some more code how i can achieve that.I am newbie in this .Please help me.
How can i use this combo box in my select html tag.


Thanks alot

Condor
9 Aug 2010, 12:03 AM
What is the problem? This method works on transformed comboboxes too (but the displayField will be called text instead of field1).