comparison app/view/widget/DynamicGrid.js @ 1259:bfdd875cdb5f

Add tooltip to DynamicGrid
author Evi Huber <ehuber@bfs.de>
date Fri, 25 Nov 2016 13:21:24 +0100
parents 4270da0f7d3b
children 96f9417c105e
comparison
equal deleted inserted replaced
1258:835042fa1a1d 1259:bfdd875cdb5f
32 /** 32 /**
33 * This sets the Store of the DynamicGrid 33 * This sets the Store of the DynamicGrid
34 */ 34 */
35 setStore: function(store){ 35 setStore: function(store){
36 var i18n = Lada.getApplication().bundle; 36 var i18n = Lada.getApplication().bundle;
37
38 this.reconfigure(store); 37 this.reconfigure(store);
39 var ptbar = this.down('pagingtoolbar'); 38 var ptbar = this.down('pagingtoolbar');
40 if (ptbar) { 39 if (ptbar) {
41 this.removeDocked(ptbar); 40 this.removeDocked(ptbar);
42 } 41 }
71 * of fields 70 * of fields
72 **/ 71 **/
73 generateColumnsAndFields: function(cols) { 72 generateColumnsAndFields: function(cols) {
74 var resultColumns = []; 73 var resultColumns = [];
75 var fields = []; 74 var fields = [];
75 var i18n = Lada.getApplication().bundle;
76 switch(this.xtype) {
77 case 'probelistgrid':
78 var tooltiptext = i18n.getMsg('probe')+' '+i18n.getMsg('open');
79 break;
80 case 'messunglistgrid':
81 var tooltiptext = i18n.getMsg('messung')+' '+i18n.getMsg('open');
82 break;
83 case 'messprogrammelistgrid':
84 var tooltiptext = i18n.getMsg('messprogramm')+' '+i18n.getMsg('open');
85 }
76 86
77 fields.push(new Ext.data.Field({ 87 fields.push(new Ext.data.Field({
78 name: 'owner' 88 name: 'owner'
79 })); 89 }));
80 fields.push(new Ext.data.Field({ 90 fields.push(new Ext.data.Field({
90 resultColumns.push({ 100 resultColumns.push({
91 xtype: 'actioncolumn', 101 xtype: 'actioncolumn',
92 text: 'RW', 102 text: 'RW',
93 dataIndex: 'readonly', 103 dataIndex: 'readonly',
94 sortable: false, 104 sortable: false,
95 tooltip: 'Probe öffnen', 105 tooltip: tooltiptext,
96 width: 30, 106 width: 30,
97 getClass: function (val, meta, rec) { 107 getClass: function (val, meta, rec) {
98 if (rec.get('readonly') === false && 108 if (rec.get('readonly') === false &&
99 rec.get('owner') === true && 109 rec.get('owner') === true &&
100 !rec.get('statusEdit')) { 110 !rec.get('statusEdit')) {
111 } 121 }
112 return 'noedit'; 122 return 'noedit';
113 }, 123 },
114 handler: function(grid, rowIndex, colIndex) { 124 handler: function(grid, rowIndex, colIndex) {
115 var rec = grid.getStore().getAt(rowIndex); 125 var rec = grid.getStore().getAt(rowIndex);
126 var tooltext = rec.proxy.url;
116 grid.fireEvent('itemdblclick', grid, rec); 127 grid.fireEvent('itemdblclick', grid, rec);
117 } 128 }
118 }); 129 });
119 130
120 for (var i = cols.length - 1; i >= 0; i--) { 131 for (var i = cols.length - 1; i >= 0; i--) {

http://lada.wald.intevation.org