diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-10-18 10:04:19 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-18 10:04:19 +1300 |
commit | b60127b12fa878db7aecf35109e42f57eed34fe3 (patch) | |
tree | e405165239075265962fee36ec3d2289f3d98b1a /web/app/view | |
parent | 531f9d5c556e9795b32099587bfa84f3b74017c4 (diff) | |
parent | 41a18fef939d249ae5ed9ac4ae35c0a4e5ed8770 (diff) | |
download | etbsa-traccar-web-b60127b12fa878db7aecf35109e42f57eed34fe3.tar.gz etbsa-traccar-web-b60127b12fa878db7aecf35109e42f57eed34fe3.tar.bz2 etbsa-traccar-web-b60127b12fa878db7aecf35109e42f57eed34fe3.zip |
Merge pull request #603 from Abyss777/cell_text_selectable
Make cell text "selectable" in all grids
Diffstat (limited to 'web/app/view')
24 files changed, 52 insertions, 88 deletions
diff --git a/web/app/view/Events.js b/web/app/view/Events.js index ca1f3ea..3f4b575 100644 --- a/web/app/view/Events.js +++ b/web/app/view/Events.js @@ -17,7 +17,7 @@ */ Ext.define('Traccar.view.Events', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'eventsView', requires: [ diff --git a/web/app/view/GridPanel.js b/web/app/view/GridPanel.js new file mode 100644 index 0000000..848af08 --- /dev/null +++ b/web/app/view/GridPanel.js @@ -0,0 +1,34 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +Ext.define('Traccar.view.GridPanel', { + extend: 'Ext.grid.Panel', + xtype: 'customGridPanel', + + requires: [ + 'Ext.grid.filters.Filters' + ], + + plugins: 'gridfilters', + + viewConfig: { + enableTextSelection: true, + getRowClass: function () { + return this.enableTextSelection ? 'x-selectable' : ''; + } + } +}); diff --git a/web/app/view/Report.js b/web/app/view/Report.js index 1289e6b..f77cfca 100644 --- a/web/app/view/Report.js +++ b/web/app/view/Report.js @@ -20,7 +20,8 @@ Ext.define('Traccar.view.Report', { xtype: 'reportView', requires: [ - 'Traccar.view.ReportController' + 'Traccar.view.ReportController', + 'Traccar.view.GridPanel' ], controller: 'report', @@ -70,7 +71,7 @@ Ext.define('Traccar.view.Report', { layout: 'card', items: [{ - xtype: 'grid', + xtype: 'customGridPanel', itemId: 'grid', listeners: { selectionchange: 'onSelectionChange' diff --git a/web/app/view/State.js b/web/app/view/State.js index d161251..690c097 100644 --- a/web/app/view/State.js +++ b/web/app/view/State.js @@ -16,7 +16,7 @@ */ Ext.define('Traccar.view.State', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'stateView', requires: [ diff --git a/web/app/view/Statistics.js b/web/app/view/Statistics.js index 55e4d50..f033e03 100644 --- a/web/app/view/Statistics.js +++ b/web/app/view/Statistics.js @@ -15,7 +15,7 @@ */ Ext.define('Traccar.view.Statistics', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'statisticsView', requires: [ diff --git a/web/app/view/edit/Attributes.js b/web/app/view/edit/Attributes.js index 2dd06be..cb07eda 100644 --- a/web/app/view/edit/Attributes.js +++ b/web/app/view/edit/Attributes.js @@ -16,17 +16,14 @@ */ Ext.define('Traccar.view.edit.Attributes', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'attributesView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.view.edit.AttributesController', 'Traccar.view.edit.Toolbar' ], - plugins: 'gridfilters', - controller: 'attributes', tbar: { diff --git a/web/app/view/edit/Calendars.js b/web/app/view/edit/Calendars.js index 1c4a2ec..23f20e2 100644 --- a/web/app/view/edit/Calendars.js +++ b/web/app/view/edit/Calendars.js @@ -17,17 +17,14 @@ */ Ext.define('Traccar.view.edit.Calendars', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'calendarsView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.view.edit.CalendarsController', 'Traccar.view.edit.Toolbar' ], - plugins: 'gridfilters', - controller: 'calendars', store: 'Calendars', diff --git a/web/app/view/edit/ComputedAttributes.js b/web/app/view/edit/ComputedAttributes.js index 5d34498..9f0b939 100644 --- a/web/app/view/edit/ComputedAttributes.js +++ b/web/app/view/edit/ComputedAttributes.js @@ -17,17 +17,14 @@ */ Ext.define('Traccar.view.edit.ComputedAttributes', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'computedAttributesView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.view.edit.ComputedAttributesController', 'Traccar.view.edit.Toolbar' ], - plugins: 'gridfilters', - controller: 'computedAttributes', store: 'ComputedAttributes', diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js index d2ba0f3..39550b6 100644 --- a/web/app/view/edit/Devices.js +++ b/web/app/view/edit/Devices.js @@ -16,11 +16,10 @@ */ Ext.define('Traccar.view.edit.Devices', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'devicesView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.AttributeFormatter', 'Traccar.view.edit.DevicesController', 'Traccar.view.ArrayListFilter', @@ -29,8 +28,6 @@ Ext.define('Traccar.view.edit.Devices', { controller: 'devices', - plugins: 'gridfilters', - store: 'VisibleDevices', stateful: true, @@ -82,6 +79,7 @@ Ext.define('Traccar.view.edit.Devices', { }, viewConfig: { + enableTextSelection: true, getRowClass: function (record) { var status = record.get('status'); if (status) { diff --git a/web/app/view/edit/Drivers.js b/web/app/view/edit/Drivers.js index 59d8d2c..9aac8cd 100644 --- a/web/app/view/edit/Drivers.js +++ b/web/app/view/edit/Drivers.js @@ -17,17 +17,14 @@ */ Ext.define('Traccar.view.edit.Drivers', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'driversView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.view.edit.DriversController', 'Traccar.view.edit.Toolbar' ], - plugins: 'gridfilters', - controller: 'drivers', store: 'Drivers', diff --git a/web/app/view/edit/Geofences.js b/web/app/view/edit/Geofences.js index 51fa768..9c564bc 100644 --- a/web/app/view/edit/Geofences.js +++ b/web/app/view/edit/Geofences.js @@ -16,17 +16,14 @@ */ Ext.define('Traccar.view.edit.Geofences', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'geofencesView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.view.edit.GeofencesController', 'Traccar.view.edit.Toolbar' ], - plugins: 'gridfilters', - controller: 'geofences', store: 'Geofences', diff --git a/web/app/view/edit/Groups.js b/web/app/view/edit/Groups.js index 691df8a..0808201 100644 --- a/web/app/view/edit/Groups.js +++ b/web/app/view/edit/Groups.js @@ -16,18 +16,15 @@ */ Ext.define('Traccar.view.edit.Groups', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'groupsView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.AttributeFormatter', 'Traccar.view.edit.GroupsController', 'Traccar.view.edit.Toolbar' ], - plugins: 'gridfilters', - controller: 'groups', store: 'Groups', diff --git a/web/app/view/edit/Notifications.js b/web/app/view/edit/Notifications.js index 8bbdb71..e17100a 100644 --- a/web/app/view/edit/Notifications.js +++ b/web/app/view/edit/Notifications.js @@ -17,17 +17,14 @@ */ Ext.define('Traccar.view.edit.Notifications', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'notificationsView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.view.edit.NotificationsController', 'Traccar.view.edit.Toolbar' ], - plugins: 'gridfilters', - controller: 'notifications', store: 'Notifications', diff --git a/web/app/view/edit/SavedCommands.js b/web/app/view/edit/SavedCommands.js index b0cf89d..794e95e 100644 --- a/web/app/view/edit/SavedCommands.js +++ b/web/app/view/edit/SavedCommands.js @@ -17,17 +17,14 @@ */ Ext.define('Traccar.view.edit.SavedCommands', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'savedCommandsView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.view.edit.SavedCommandsController', 'Traccar.view.edit.Toolbar' ], - plugins: 'gridfilters', - controller: 'savedCommands', store: 'Commands', diff --git a/web/app/view/edit/Users.js b/web/app/view/edit/Users.js index d98d49c..fd37199 100644 --- a/web/app/view/edit/Users.js +++ b/web/app/view/edit/Users.js @@ -17,11 +17,10 @@ */ Ext.define('Traccar.view.edit.Users', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', xtype: 'usersView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.view.edit.UsersController', 'Traccar.view.edit.Toolbar' ], @@ -29,8 +28,6 @@ Ext.define('Traccar.view.edit.Users', { controller: 'users', store: 'Users', - plugins: 'gridfilters', - tbar: { xtype: 'editToolbar', scrollable: true, diff --git a/web/app/view/permissions/Base.js b/web/app/view/permissions/Base.js index 2b07d84..5701753 100644 --- a/web/app/view/permissions/Base.js +++ b/web/app/view/permissions/Base.js @@ -16,7 +16,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ Ext.define('Traccar.view.permissions.Base', { - extend: 'Ext.grid.Panel', + extend: 'Traccar.view.GridPanel', requires: [ 'Traccar.view.permissions.BaseController' diff --git a/web/app/view/permissions/Calendars.js b/web/app/view/permissions/Calendars.js index ff2796b..3d08efc 100644 --- a/web/app/view/permissions/Calendars.js +++ b/web/app/view/permissions/Calendars.js @@ -20,12 +20,6 @@ Ext.define('Traccar.view.permissions.Calendars', { extend: 'Traccar.view.permissions.Base', xtype: 'linkCalendarsView', - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - columns: { items: [{ text: Strings.sharedName, diff --git a/web/app/view/permissions/ComputedAttributes.js b/web/app/view/permissions/ComputedAttributes.js index 800717c..19af72a 100644 --- a/web/app/view/permissions/ComputedAttributes.js +++ b/web/app/view/permissions/ComputedAttributes.js @@ -20,12 +20,6 @@ Ext.define('Traccar.view.permissions.ComputedAttributes', { extend: 'Traccar.view.permissions.Base', xtype: 'linkComputedAttributesView', - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - columns: { items: [{ text: Strings.sharedDescription, diff --git a/web/app/view/permissions/Devices.js b/web/app/view/permissions/Devices.js index 4cadafe..d120eac 100644 --- a/web/app/view/permissions/Devices.js +++ b/web/app/view/permissions/Devices.js @@ -20,12 +20,9 @@ Ext.define('Traccar.view.permissions.Devices', { xtype: 'linkDevicesView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.AttributeFormatter' ], - plugins: 'gridfilters', - columns: { items: [{ text: Strings.sharedName, diff --git a/web/app/view/permissions/Drivers.js b/web/app/view/permissions/Drivers.js index f0ea289..33cf2f7 100644 --- a/web/app/view/permissions/Drivers.js +++ b/web/app/view/permissions/Drivers.js @@ -20,12 +20,6 @@ Ext.define('Traccar.view.permissions.Drivers', { extend: 'Traccar.view.permissions.Base', xtype: 'linkDriversView', - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - columns: { items: [{ text: Strings.sharedName, diff --git a/web/app/view/permissions/Geofences.js b/web/app/view/permissions/Geofences.js index 84135d3..efdf18d 100644 --- a/web/app/view/permissions/Geofences.js +++ b/web/app/view/permissions/Geofences.js @@ -19,12 +19,6 @@ Ext.define('Traccar.view.permissions.Geofences', { extend: 'Traccar.view.permissions.Base', xtype: 'linkGeofencesView', - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - columns: { items: [{ text: Strings.sharedName, diff --git a/web/app/view/permissions/Groups.js b/web/app/view/permissions/Groups.js index d3cad98..91a639c 100644 --- a/web/app/view/permissions/Groups.js +++ b/web/app/view/permissions/Groups.js @@ -20,12 +20,9 @@ Ext.define('Traccar.view.permissions.Groups', { xtype: 'linkGroupsView', requires: [ - 'Ext.grid.filters.Filters', 'Traccar.AttributeFormatter' ], - plugins: 'gridfilters', - columns: { items: [{ text: Strings.sharedName, diff --git a/web/app/view/permissions/Notifications.js b/web/app/view/permissions/Notifications.js index 6538e67..9386d6d 100644 --- a/web/app/view/permissions/Notifications.js +++ b/web/app/view/permissions/Notifications.js @@ -20,12 +20,6 @@ Ext.define('Traccar.view.permissions.Notifications', { extend: 'Traccar.view.permissions.Base', xtype: 'linkNotificationsView', - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - columns: { items: [{ text: Strings.notificationType, diff --git a/web/app/view/permissions/SavedCommands.js b/web/app/view/permissions/SavedCommands.js index 106fad5..52b759b 100644 --- a/web/app/view/permissions/SavedCommands.js +++ b/web/app/view/permissions/SavedCommands.js @@ -20,12 +20,6 @@ Ext.define('Traccar.view.permissions.SavedCommands', { extend: 'Traccar.view.permissions.Base', xtype: 'linkSavedCommandsView', - requires: [ - 'Ext.grid.filters.Filters' - ], - - plugins: 'gridfilters', - columns: { items: [{ text: Strings.sharedDescription, |