changeset 272:852dc338894e

Make custom comboboxed selectable
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 06 Aug 2013 16:53:47 +0200
parents 11f8a2c1b610
children a282da79cfaa
files app/view/widgets/Messmethode.js app/view/widgets/Uwb.js
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/widgets/Messmethode.js	Tue Aug 06 16:03:38 2013 +0200
+++ b/app/view/widgets/Messmethode.js	Tue Aug 06 16:53:47 2013 +0200
@@ -17,7 +17,7 @@
 });
 
 Ext.define('Lada.view.widgets.Messmethode' ,{
-        tpl: '<tpl for="."><div class="x-combo-list-item" >{mmtId} - {messmethhode}</div></tpl>',
+        tpl: '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >{mmtId} - {messmethhode}</div></tpl>',
         extend: 'Ext.form.ComboBox',
         alias: 'widget.messmethode',
         store: mmtStore,
--- a/app/view/widgets/Uwb.js	Tue Aug 06 16:03:38 2013 +0200
+++ b/app/view/widgets/Uwb.js	Tue Aug 06 16:53:47 2013 +0200
@@ -17,13 +17,26 @@
 });
 
 Ext.define('Lada.view.widgets.Uwb' ,{
-        tpl: '<tpl for="."><div class="x-combo-list-item" >{umwId} - {umweltBereich}</div></tpl>',
+        tpl: '<tpl for="."><div class="x-combo-list-item  x-boundlist-item" >{umwId} - {umweltBereich}</div></tpl>',
         extend: 'Ext.form.ComboBox',
         alias: 'widget.uwb',
         store: uwbStore,
         displayField:'umwId',
         valueField: 'umwId',
         emptyText:'Wählen Sie einen Umweltbereich',
+        // TODO: Set value in disply after selection. Can not figure out why
+        // accessing the recored.data attribute fails here (ti) <2013-08-06 16:52> 
+        //listeners: {
+        //    select: function(combo, record, index) {
+        //        console.log("1");
+        //        console.log(record);
+        //        console.log("2");
+        //        var text = record.data['umwId'] + " - " + record.data['umweltBereich'];
+        //        console.log("3");
+        //        Ext.form.ComboBox.superclass.setValue.call(this, text);
+        //        combo.value = record.id;
+        //    }
+        //},
     initComponent: function() {
         this.callParent(arguments);
     }

http://lada.wald.intevation.org