var ComboChooser=function(a){this.store=new Ext.data.JsonStore({id:"combochooser-store",url:a.url,fields:["id","title","text"]});this.store.load({callback:b,scope:this});function b(){this.detailsTpl=new Ext.XTemplate('<tpl for=".">','<div class="roundbox-tl"><div class="roundbox-tr"><div class="roundbox-tm"></div></div></div>','<div class="roundbox-ml"><div class="roundbox-mr"><div class="roundbox-mm">','<div class="roundbox-content">','<div class="details-wrap">','<h2  class="sIFR-ignore">{title}</h2>',"<p>{text}</p>","</div>","</div>","</div></div></div>",'<div class="roundbox-bl"><div class="roundbox-br"><div class="roundbox-bm"/></div></div></div>',"</tpl>");this.detailsTpl.compile();this.combo=new Ext.form.ComboBox({id:"chooser-combo",renderTo:a.comboCtn,store:this.store,valueField:"id",displayField:"title",typeAhead:true,mode:"local",triggerAction:"all",emptyText:"Välj fläck...",selectOnFocus:true,listeners:{select:{fn:this.showDetails,scope:this}}});this.detailsPanel=new Ext.Panel({id:"tip-panel",border:false,renderTo:a.viewCtn,hidden:true,title:"",items:[{border:false,items:new Ext.Panel({id:"details-view",border:false,html:""})}]})}};ComboChooser.prototype={showDetails:function(){if(this.detailsPanel.hidden){this.detailsPanel.show()}this.combo.getValue();var b=this.store.find("id",this.combo.getValue());var a=this.store.getAt(b);Ext.getCmp("details-view").getEl().hide();this.detailsTpl.overwrite(Ext.getCmp("details-view").getEl(),a.data);Ext.getCmp("details-view").getEl().fadeIn()}};