PDA

View Full Version : Customized combobox



pra123@
2 Apr 2013, 8:04 AM
I have a combobox. I am setting tpl config as follows
var newTpl = Ext.create('Ext.XTemplate',
'<tpl for=".">',
'<div class="x-boundlist-item">{Materialname} &nbsp;&nbsp;|&nbsp;&nbsp; {status}</div>',
'</tpl>');
combo.tpl = newTpl;

My problem is when the text length is more then its not showning in single line. (As in image with red color).

Is the any way to enable horizontal scrollbar?
Can any one help me how to do this?

slemmon
4 Apr 2013, 10:47 AM
Not sure there's a very straightforward way of doing that without tailoring the boundlist's (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.view.BoundList) width and overflow outside of it's default scroll behavior.

You might check out the boundlist (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.view.BoundList)'s configs which can be added to the combobox's (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.form.field.ComboBox) config via listConfig (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.form.field.ComboBox-cfg-listConfig).

You might also see if setting combobox's matchFieldWidth (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.form.field.ComboBox-cfg-matchFieldWidth) config to false is of any benefit to you.