make role choosing fluent
authorCornelius Weiß <c.weiss@metaways.de>
Sat, 15 Jul 2017 16:43:37 +0000 (18:43 +0200)
committerCornelius Weiss <c.weiss@metaways.de>
Sat, 15 Jul 2017 16:40:39 +0000 (18:40 +0200)
Change-Id: I7565bcdc770e7279a694acd6bfc8fd4f503da647
Reviewed-on: http://gerrit.tine20.com/customers/5202
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
Tested-by: Cornelius Weiss <c.weiss@metaways.de>
tine20/Calendar/js/AttendeeGridPanel.js

index d498c4b..c9530ce 100644 (file)
@@ -160,13 +160,7 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
             editor: {
                 xtype: 'widget-keyfieldcombo',
                 app:   'Calendar',
-                keyFieldName: 'attendeeRoles',
-                listeners: {
-                    scope: this,
-                    change: function (field, newValue) {
-                        this.setDefaultAttendeeRole(newValue);
-                    }
-                }
+                keyFieldName: 'attendeeRoles'
             }
         }, {
             id: 'displaycontainer_id',
@@ -353,10 +347,17 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
                 }
                 break;
                 
-            case 'user_type' :
-                this.startEditing(o.row, o.column +1);
+            case 'user_type':
+                this.startEditing(o.row, this.getColumnModel().getIndexById('user_id'));
+                break;
+
+            case 'role':
+                if (o.row == this.store.getCount()-1) {
+                    this.setDefaultAttendeeRole(o.record.get('role'));
+                    this.startEditing(o.row, this.getColumnModel().getIndexById('user_id'));
+                }
+
                 break;
-            
             case 'container_id':
                 // check if displaycontainer of owner got changed
                 if (o.record == this.eventOriginator) {