Mercurial > lada > lada-client
comparison app/view/widget/Deskriptor.js @ 925:81e7c847cb58
Clear child descriptor fields on descriptor change.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 11 Sep 2015 12:20:20 +0200 |
parents | 43f3a53d07d3 |
children |
comparison
equal
deleted
inserted
replaced
924:9265637fe6c0 | 925:81e7c847cb58 |
---|---|
22 remoteFilter: true, | 22 remoteFilter: true, |
23 tpl: Ext.create('Ext.XTemplate', | 23 tpl: Ext.create('Ext.XTemplate', |
24 '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >' + | 24 '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >' + |
25 '{sn} - {beschreibung}</div></tpl>'), | 25 '{sn} - {beschreibung}</div></tpl>'), |
26 displayTpl: Ext.create('Ext.XTemplate', | 26 displayTpl: Ext.create('Ext.XTemplate', |
27 '<tpl for=".">{sn} - {beschreibung}</tpl>'), | 27 '<tpl for="."><tpl if="sn > 0">{sn} - {beschreibung}</tpl></tpl>'), |
28 | 28 |
29 listeners: { | 29 listeners: { |
30 focus: { | 30 focus: { |
31 fn: function(field) { | 31 fn: function(field) { |
32 if (field.up('deskriptor').layer === 0) { | 32 if (field.up('deskriptor').layer === 0) { |
39 'layer': field.up('deskriptor').layer, | 39 'layer': field.up('deskriptor').layer, |
40 'parents': parents | 40 'parents': parents |
41 }; | 41 }; |
42 field.store.load(); | 42 field.store.load(); |
43 } | 43 } |
44 else { | |
45 field.store.proxy.extraParams = { | |
46 'layer': field.up('deskriptor').layer | |
47 }; | |
48 field.store.load(); | |
49 } | |
44 } | 50 } |
45 } | 51 } |
46 } | 52 } |
47 }, | 53 }, |
48 | 54 |
49 initComponent: function() { | 55 initComponent: function() { |
50 this.store = Ext.create('Lada.store.Deskriptoren'); | 56 this.store = Ext.create('Lada.store.Deskriptoren'); |
57 this.store.on('load', function() { | |
58 this.insert(0, {sn: 0, beschreibung: 'leer'}); | |
59 if (this.proxy.extraParams.layer > 0 && | |
60 !this.proxy.extraParams.parents) { | |
61 this.removeAll(); | |
62 } | |
63 }, this.store); | |
51 | 64 |
52 this.callParent(arguments); | 65 this.callParent(arguments); |
53 this.down('combobox').isFormField = false; | 66 this.down('combobox').isFormField = false; |
54 }, | 67 }, |
55 | 68 |