[Lada-commits] [PATCH 2 of 3] Add/Remove is now reliable
Wald Commits
scm-commit at wald.intevation.org
Tue May 12 15:09:24 CEST 2015
# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1431435234 -7200
# Node ID 5ee59111b1881a0eb88d1508a764d77690b4a79d
# Parent 31eaed998531e51ae562edb8c250720eeb148a1d
Add/Remove is now reliable
diff -r 31eaed998531 -r 5ee59111b188 app/controller/grid/Messmethode.js
--- a/app/controller/grid/Messmethode.js Tue May 12 14:24:41 2015 +0200
+++ b/app/controller/grid/Messmethode.js Tue May 12 14:53:54 2015 +0200
@@ -85,7 +85,32 @@
*/
gridSaveNuklid: function(editor, context) {
console.log(context);
- this.syncArray(context.store);
+ var modified = false;
+ var id = context.newValues.id;
+ var mg = this.record.get('messgroessen');
+
+ //Test if this Nuklid already exists.
+ if (Array.isArray(id)){
+ for (i in id) {
+ //Only insert if value does not exist
+ if (! Ext.Array.contains(mg, id[i])) {
+ modified = true;
+ }
+ }
+ }
+ else {
+ if (! Ext.Array.contains(mg, id)) {
+ mg.push(id);
+ modified = true;
+ }
+ }
+
+ if (modified) {
+ this.syncArray(context.store);
+ }
+ else {
+ editor.getCmp().store.remove(context.record);
+ }
},
/**
diff -r 31eaed998531 -r 5ee59111b188 app/view/grid/Messmethoden.js
--- a/app/view/grid/Messmethoden.js Tue May 12 14:24:41 2015 +0200
+++ b/app/view/grid/Messmethoden.js Tue May 12 14:53:54 2015 +0200
@@ -17,12 +17,12 @@
'Lada.view.widget.Messmethode'
],
- maxHeight: 350,
- minHeight: 110,
+ maxHeight: 150,
+ minHeight: 150,
viewConfig: {
deferEmptyText: false
},
- margin: '0, 5, 5, 5',
+ //margin: '0, 0, 5, 5',
recordId: null,
diff -r 31eaed998531 -r 5ee59111b188 app/view/grid/Nuklide.js
--- a/app/view/grid/Nuklide.js Tue May 12 14:24:41 2015 +0200
+++ b/app/view/grid/Nuklide.js Tue May 12 14:53:54 2015 +0200
@@ -17,12 +17,13 @@
'Lada.view.widget.Messgroesse'
],
- maxHeight: 350,
- minHeight: 110,
+ maxHeight: 150,
+ minHeight: 150,
viewConfig: {
- deferEmptyText: false
+ deferEmptyText: false,
+ markDirty: false //Remove Dirty-Flags
},
- margin: '0, 5, 5, 5',
+ //margin: '0, 0, 5, 5',
recordId: null,
More information about the Lada-commits
mailing list