torsten@4: Ext.define('Lada.view.proben.List' ,{ torsten@4: extend: 'Ext.grid.Panel', torsten@4: alias: 'widget.probenlist', torsten@13: store: 'Proben', torsten@37: viewConfig: { torsten@37: maxHeight: 350, torsten@37: emptyText: 'Keine Proben gefunden.', torsten@37: // minHeight and deferEmptyText are needed to be able to show the torsten@37: // emptyText message. torsten@37: minHeight: 35, torsten@37: deferEmptyText: false torsten@37: }, torsten@237: availableColumns: [ torsten@237: {header: 'Datenbasis', dataIndex: 'datenbasisId', width: 70}, torsten@237: {header: 'MPL', dataIndex: 'mplId', width: 50}, torsten@237: {header: 'UWB', dataIndex: 'umwId', width: 50}, torsten@237: {header: 'MMT', dataIndex: 'messmethode'}, torsten@237: {header: 'HPNR', dataIndex: 'hauptprobenNr'}, torsten@237: {header: 'NPNR', dataIndex: 'nebenprobenNr'}, torsten@237: {header: 'E.Gemeinde', dataIndex: 'bezeichnung', flex: 1}, torsten@237: {header: 'Ursprungsgemeinde', dataIndex: 'kreis', flex: 1}, torsten@237: {header: 'ProbeID', dataIndex: 'probeId'}, torsten@237: {header: 'MST', dataIndex: 'mstId', width: 50} torsten@237: ], torsten@4: initComponent: function() { torsten@63: this.dockedItems = [ torsten@63: { torsten@63: xtype: 'toolbar', torsten@63: dock: 'top', torsten@63: items: [ torsten@63: { torsten@63: text: 'Hinzufügen', torsten@63: icon: 'gfx/plus.gif', torsten@63: action: 'add' torsten@63: } torsten@63: ] torsten@63: } torsten@63: ]; torsten@238: this.columns = []; torsten@4: this.callParent(arguments); torsten@239: }, torsten@249: setupColumns: function(cols) { torsten@249: var rcols = [] torsten@258: rcols.push({header: 'RW', dataIndex: 'readonly', width: 30, renderer: render_readonly}); torsten@249: for (var i = cols.length - 1; i >= 0; i--){ torsten@249: rcols.push(cols[i]); torsten@239: }; torsten@249: this.reconfigure(this.store, rcols); torsten@4: } torsten@4: }); torsten@258: torsten@258: function render_readonly (value) { torsten@258: if (value) { torsten@258: return '🔒' torsten@258: } else { torsten@258: return '🔓' torsten@258: } torsten@258: }