comparison app/controller/grid/Status.js @ 996:bf7bb9583a40

Statusworkflow: More work on the reset Button
author Dustin Demuth <dustin@intevation.de>
date Fri, 08 Jan 2016 14:34:27 +0100
parents 092e245b13a4
children 4bbb3da88c14
comparison
equal deleted inserted replaced
995:fb424948de02 996:bf7bb9583a40
130 var s = button.up('window').down('messungform').getRecord().get('status'); 130 var s = button.up('window').down('messungform').getRecord().get('status');
131 var messId = button.up('window').down('messungform').getRecord().get('id'); 131 var messId = button.up('window').down('messungform').getRecord().get('id');
132 var recentStatus = button.up('statusgrid').store.getById(s); 132 var recentStatus = button.up('statusgrid').store.getById(s);
133 133
134 //Set Status to 'Resetted' (8) 134 //Set Status to 'Resetted' (8)
135 var record = recentStatus.copy(); 135 if (recentStatus) {
136 record.set('datum', new Date()); 136 var record = recentStatus.copy();
137 record.set('statusWert', 8); 137 record.set('datum', new Date());
138 record.set('id', null); 138 record.set('statusWert', 8);
139 record.set('text', null); 139 record.set('id', null);
140 record.set('text', null);
141 }
140 142
141 Ext.Ajax.request({ 143 Ext.Ajax.request({
142 url: 'lada-server/status', 144 url: 'lada-server/status',
143 jsonData: record.getData(), 145 jsonData: record.getData(),
144 method: 'POST', 146 method: 'POST',
145 success: function(response) { 147 success: function(response) {
146 button.up('window').initData(); 148 button.up('window').initData();
149 button.up('grid').initData();
147 }, 150 },
148 failure: function(response) { 151 failure: function(response) {
149 // TODO sophisticated error handling, with understandable Texts 152 // TODO sophisticated error handling, with understandable Texts
150 var json = Ext.JSON.decode(response.responseText); 153 var json = Ext.JSON.decode(response.responseText);
151 if (json) { 154 if (json) {

http://lada.wald.intevation.org