PDA

View Full Version : Image Picker Combo Box



Gamer
1 Feb 2011, 8:53 AM
I'm trying to build an image picker combobox, that displays the images while you choose them.


initComponent: function() {
Ext.ux.form.ImagePicker.superclass.initComponent.call(this);
this.tpl = this.tpl ||
'<tpl for="."><div class="x-combo-list-item ext-color-{' + this.valueField +
'}"><div class="ext-cal-picker-icon">&nbsp;</div>{' + this.displayField + '}</div></tpl>';
},


This is from the example calendar that has a combobox where you choose a marker i.e. school, work, etc. and it also pulls a small colored circle image with it. I want to be able to just call the image.



this.tpl = this.tpl ||
'<tpl for="."><div class="x-combo-list-item"><img src=" this.valueField"><div class="ext-cal-picker-icon">&nbsp;</div>{' + this.displayField + '}</div></tpl>';
},


This is the starting point that I was given to work off of, any help is appreciated.

Gamer
1 Feb 2011, 9:38 AM
It should && for both of them not ||, so I updated the bottom piece of code to reflect how it should actually be. Oops!


this.tpl = this.tpl &&
'<tpl for="."><div class="x-combo-list-item"><img src=" this.valueField"><div class="ext-cal-picker-icon">&nbsp;</div>{' + this.displayField + '}</div></tpl>';
},

Condor
2 Feb 2011, 1:51 AM
I'm sure there's a question in here somewhere, but what is it?

Gamer
3 Feb 2011, 8:41 AM
sorry I was kind of unsure what to ask, but I was taken off of working on this anyways :D