comparison app/controller/Ort.js @ 1132:c213c3dc51d2

Expand ort grid on add ort button clicked.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 25 May 2016 14:36:16 +0200
parents e4952906634d
children 7ac4d811cf89
comparison
equal deleted inserted replaced
1131:6549abef70e1 1132:c213c3dc51d2
31 }); 31 });
32 }, 32 },
33 33
34 featureadded: function(record) { 34 featureadded: function(record) {
35 var grid = Ext.ComponentQuery.query('ortpanel ortstammdatengrid')[0]; 35 var grid = Ext.ComponentQuery.query('ortpanel ortstammdatengrid')[0];
36 if (grid.getCollapsed()) {
37 grid.expand();
38 }
36 if (!record.get('letzteAenderung')) { 39 if (!record.get('letzteAenderung')) {
37 record.data.letzteAenderung = new Date(); 40 record.data.letzteAenderung = new Date();
38 } 41 }
39 grid.store.insert(0, record); 42 grid.store.insert(0, record);
40 grid.rowEditing.startEdit(0, 1); 43 grid.rowEditing.startEdit(0, 1);
45 var record = Ext.create('Lada.model.Ort'); 48 var record = Ext.create('Lada.model.Ort');
46 map.activateDraw(record); 49 map.activateDraw(record);
47 }, 50 },
48 51
49 addRecord: function(button) { 52 addRecord: function(button) {
50 console.log('add record');
51 var record = Ext.create('Lada.model.Ort'); 53 var record = Ext.create('Lada.model.Ort');
52 var grid = button.up('ortpanel').down('ortstammdatengrid'); 54 var grid = button.up('ortpanel').down('ortstammdatengrid');
55 if (grid.getCollapsed()) {
56 grid.expand();
57 }
53 if (!record.get('letzteAenderung')) { 58 if (!record.get('letzteAenderung')) {
54 record.data.letzteAenderung = new Date(); 59 record.data.letzteAenderung = new Date();
55 } 60 }
56 grid.store.insert(0, record); 61 grid.store.insert(0, record);
57 grid.rowEditing.startEdit(0, 1); 62 grid.rowEditing.startEdit(0, 1);

http://lada.wald.intevation.org