Pwirth has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/321667

Change subject: Bugfix for "grouping feature" in gridpanel
......................................................................

Bugfix for "grouping feature" in gridpanel

See inline documentation.

NEED CHERRY-PICK TO MASTER AND REL1_27!

Change-Id: I8a6c6256469ea7f70ff747667bacaffecc579c07
(cherry picked from commit 9f771be0cb207abaf9730a9b620e96f0dbabbd73)
---
M resources/bluespice.extjs/BS/CRUDGridPanel.js
M resources/bluespice.extjs/bluespice.extjs.js
2 files changed, 34 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/67/321667/1

diff --git a/resources/bluespice.extjs/BS/CRUDGridPanel.js 
b/resources/bluespice.extjs/BS/CRUDGridPanel.js
index 40bd6e8..50daa5c 100644
--- a/resources/bluespice.extjs/BS/CRUDGridPanel.js
+++ b/resources/bluespice.extjs/BS/CRUDGridPanel.js
@@ -212,17 +212,13 @@
                this.grdMain.getSelectionModel().deselectAll();
        },
 
-       onActionEditClick:function(grid, rowIndex, colIndex) {
-               this.grdMain.getSelectionModel().select(
-                       this.grdMain.getStore().getAt( rowIndex )
-               );
+       onActionEditClick:function( view, rowIndex, colIndex, item, e, record, 
row ) {
+               this.grdMain.getSelectionModel().select( record );
                this.onBtnEditClick( this.btnEdit, {} );
        },
 
-       onActionRemoveClick:function(grid, rowIndex, colIndex) {
-               this.grdMain.getSelectionModel().select(
-                       this.grdMain.getStore().getAt( rowIndex )
-               );
+       onActionRemoveClick:function(view, rowIndex, colIndex, item, e, record, 
row ) {
+               this.grdMain.getSelectionModel().select( record );
                this.onBtnRemoveClick( this.btnRemove, {} );
        },
 
diff --git a/resources/bluespice.extjs/bluespice.extjs.js 
b/resources/bluespice.extjs/bluespice.extjs.js
index 3df4cc3..14a881c 100755
--- a/resources/bluespice.extjs/bluespice.extjs.js
+++ b/resources/bluespice.extjs/bluespice.extjs.js
@@ -74,6 +74,36 @@
                }
        });
 
+       /**
+        * There is a bug in our version of ExtJS: When having a 
"Ext.grid.Panel"
+        * with an "Ext.grid.feature.Grouping" and the user has collapsed one or
+        * more groups, then in the "handler"-callback of an
+        * "Ext.grid.column.Action" the passed record/rowIndex will be wrong!
+        * This bug got probably fixed in version "4.2.2.1144", wich is
+        * unfortunately not available for non-support-subscribers of Sencha 
Inc.
+        * Therefore we implement this bugfix here and wait for a future update.
+        * See also 
https://www.sencha.com/forum/showthread.php?264961-Grid-Grouping-Bug&p=973054&viewfull=1#post973054
+        */
+       Ext.override( Ext.view.Table, {
+               getRecord: function ( node ) {
+                       node = this.getNode( node );
+                       if ( node ) {
+                               return this.dataSource.data.get(
+                                       node.getAttribute( 'data-recordId' )
+                               );
+                       }
+               },
+               indexInStore: function ( node ) {
+                       node = this.getNode( node, true );
+                       if ( !node && node !== 0 ) {
+                               return -1;
+                       }
+                       return this.dataSource.indexOf(
+                               this.getRecord( node )
+                       );
+               }
+       });
+
        /*
        //TODO: Find a way to have BS.Window and BS.Panel shorthands for
        //mw.message.plain() and this.getId()+'-SubComponent'

-- 
To view, visit https://gerrit.wikimedia.org/r/321667
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a6c6256469ea7f70ff747667bacaffecc579c07
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27
Gerrit-Owner: Pwirth <wi...@hallowelt.biz>
Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to