[Lada-commits] [PATCH 4 of 5] Use custom row expander in messung list grid
Wald Commits
scm-commit at wald.intevation.org
Tue May 17 17:13:10 CEST 2016
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1463497953 -7200
# Node ID e76551a6da276977e785ebd142bece385634c4cb
# Parent a73726bba79c40408c4d1d729b4612b76a50efb3
Use custom row expander in messung list grid.
diff -r a73726bba79c -r e76551a6da27 app/controller/Filter.js
--- a/app/controller/Filter.js Tue May 17 17:12:07 2016 +0200
+++ b/app/controller/Filter.js Tue May 17 17:12:33 2016 +0200
@@ -138,7 +138,15 @@
break;
case 'messung':
gridstore = Ext.create('Lada.store.MessungenList');
- frgrid = Ext.create('Lada.view.grid.MessungList');
+ frgrid = Ext.create('Lada.view.grid.MessungList', {
+ plugins: [{
+ ptype: 'gridrowexpander',
+ gridType: 'Lada.view.grid.Messwert',
+ gridConfig: {
+ bottomBar: false
+ }
+ }]
+ });
break;
case 'messprogramm':
gridstore = Ext.create('Lada.store.MessprogrammeList');
diff -r a73726bba79c -r e76551a6da27 app/view/grid/MessungList.js
--- a/app/view/grid/MessungList.js Tue May 17 17:12:07 2016 +0200
+++ b/app/view/grid/MessungList.js Tue May 17 17:12:33 2016 +0200
@@ -17,7 +17,8 @@
var i18n = Lada.getApplication().bundle;
this.emptyText = i18n.getMsg('messung.emptyGrid');
this.selModel = Ext.create('Ext.selection.CheckboxModel', {
- checkOnly: true
+ checkOnly: true,
+ injectCheckbox: 1
});
this.dockedItems = [{
diff -r a73726bba79c -r e76551a6da27 app/view/grid/Messwert.js
--- a/app/view/grid/Messwert.js Tue May 17 17:12:07 2016 +0200
+++ b/app/view/grid/Messwert.js Tue May 17 17:12:33 2016 +0200
@@ -30,6 +30,7 @@
readOnly: true,
allowDeselect: true,
messgroesseStore: null,
+ bottomBar: true,
initComponent: function() {
this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
@@ -42,6 +43,12 @@
// Normally this would belong into a controller an not the view.
// But the RowEditPlugin is not handled there.
beforeedit: function(e, o) {
+ // We are not in a messung window!
+ if (!o.grid.up('window')) {
+ return false;
+ }
+ // We are in a messung window and should check if we can
+ // edit.
var readonlywin = o.grid.up('window').record.get('readonly');
var readonlygrid = o.record.get('readonly');
if (readonlywin == true || readonlygrid == true || this.disabled) {
@@ -186,6 +193,9 @@
this.initData();
this.callParent(arguments);
this.setReadOnly(true); //Grid is always initialised as RO
+ if (!me.bottomBar) {
+ this.down('toolbar[dock=bottom]').hide();
+ }
},
initData: function() {
More information about the Lada-commits
mailing list