-
30 Mar 2009 9:22 AM #1
Yet another combo select problem...
Yet another combo select problem...
first off yes this is similar to http://extjs.com/forum/showthread.php?t=63321, but the solution there did not help me with my problem so I am starting another thread....
When the combobox is expanded all that is shown is a blank selection. Yet if that one item is selected then the first item in the array is chosen but I have no access to the other two elements in the array
An example is shown below:
Expanded:
comboBox1..jpg
after the item is selected:
comboBox2..jpg
.. and the &# 160; has a space for it to show up here but in my code that space is not there.Code:var purposeCombo = new Ext.form.ComboBox({ store:new Ext.data.SimpleStore({data:[['t','Testing'],['i','Inspection'],['m','Meeting']],fields:['letter','disp']}), tpl:new Ext.XTemplate('<tpl for =".">','<div class="x-combo-list-item">{disp:defaultValue("&# 160;")}</div>','</tpl>'), //typeAhead: true, //forceSelection: true, displayField: 'disp', mode: 'local', triggerAction: 'all', emptyText: 'Select purpose ... ', selectOnFocus: true, fieldLabel:'Purpose', listClass: 'x-combo-list', });
My experience with XTemplate is very limited so I think I am just missing something there even though other examples are very similar to this one.
-
31 Mar 2009 2:00 AM #2
-
31 Mar 2009 6:12 AM #3
Thanks rob for the link. I guess my extensive search of the postings was not that extensive after all.
I did solve the problem but not my confusion of what is happening. The solution was something I had tried many times beforeActually all I had to do was remove the defaultValue(&# 160;') and the combo Box works the way I expect it to. The confusion comes from the fact that I have to use this defaultValue in another comboBox in this application, if I remove it from that comboBox's tpl then it displays nothing as well... there really is no difference between these two elements yet the XTemplate for them has to be different. I guess there is a difference between them that I don't see. All this has done for me is make the XTemplate more of a mystery to me...Code:var purposeCombo = new Ext.form.ComboBox({ store:new Ext.data.SimpleStore({data:[ ['T', 'Testing'], ['I', 'Inspection'], ['M', 'Meeting'] ], fields:['letter','disp'] }), //tpl:new Ext.XTemplate('<tpl for ="."><div class="x-combo-list-item">{disp:defaultValue(" ")}</div></tpl>'), tpl: new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">{disp}</div></tpl>'), //typeAhead: true, //forceSelection: true, displayField: 'disp', mode: 'local', triggerAction: 'all', emptyText: 'Select purpose ... ', selectOnFocus: true, fieldLabel:'Purpose', listClass: 'x-combo-list', });


Reply With Quote