Mercurial > lada > lada-client
comparison app/view/proben/List.js @ 491:850ccfe5f3c4
Code style.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 31 Oct 2014 23:23:32 +0100 |
parents | debfcc7713e3 |
children |
comparison
equal
deleted
inserted
replaced
490:446e99cfd425 | 491:850ccfe5f3c4 |
---|---|
10 * Grid to list Proben | 10 * Grid to list Proben |
11 */ | 11 */ |
12 Ext.define('Lada.view.proben.List' ,{ | 12 Ext.define('Lada.view.proben.List' ,{ |
13 extend: 'Ext.grid.Panel', | 13 extend: 'Ext.grid.Panel', |
14 alias: 'widget.probenlist', | 14 alias: 'widget.probenlist', |
15 | |
15 store: 'ProbenList', | 16 store: 'ProbenList', |
16 multiSelect: true, | 17 multiSelect: true, |
17 viewConfig: { | 18 viewConfig: { |
18 emptyText: 'Keine Proben gefunden.', | 19 emptyText: 'Keine Proben gefunden.', |
19 deferEmptyText: false | 20 deferEmptyText: false |
20 }, | 21 }, |
22 | |
21 initComponent: function() { | 23 initComponent: function() { |
22 this.dockedItems = [ | 24 this.dockedItems = [{ |
23 { | 25 xtype: 'toolbar', |
24 xtype: 'toolbar', | 26 dock: 'top', |
25 dock: 'top', | 27 items: [{ |
26 items: [ | 28 text: 'Hinzufügen', |
27 { | 29 icon: 'gfx/list-add.png', |
28 text: 'Hinzufügen', | 30 action: 'add' |
29 icon: 'gfx/list-add.png', | 31 }, { |
30 action: 'add' | 32 text: 'Import', |
31 }, | 33 icon: 'gfx/svn-commit.png', |
32 { | 34 action: 'import' |
33 text: 'Import', | 35 }, { |
34 icon: 'gfx/svn-commit.png', | 36 text: 'Export', |
35 action: 'import' | 37 icon: 'gfx/svn-update.png', |
36 }, | 38 action: 'export' |
37 { | 39 }] |
38 text: 'Export', | 40 }]; |
39 icon: 'gfx/svn-update.png', | |
40 action: 'export' | |
41 } | |
42 ] | |
43 } | |
44 ]; | |
45 this.columns = []; | 41 this.columns = []; |
46 this.callParent(arguments); | 42 this.callParent(arguments); |
47 }, | 43 }, |
44 | |
48 /** | 45 /** |
49 * Setup columns of the Grid dynamically based on a list of given cols. | 46 * Setup columns of the Grid dynamically based on a list of given cols. |
50 * The function is called from the {@link Lada.controller.Sql#selectSql | 47 * The function is called from the {@link Lada.controller.Sql#selectSql |
51 * select sql event} | 48 * select sql event} |
52 * @parameter {Array} List of cols to show in the Grid. | 49 * @parameter {Array} List of cols to show in the Grid. |
53 */ | 50 */ |
54 setupColumns: function(cols) { | 51 setupColumns: function(cols) { |
55 var rcols = []; | 52 var rcols = []; |
56 var mfields = []; | 53 var mfields = []; |
57 | 54 |
58 rcols.push({header: 'RW', dataIndex: 'readonly', width: 30, renderer: render_readonly}); | 55 rcols.push({ |
56 header: 'RW', | |
57 dataIndex: 'readonly', | |
58 width: 30, | |
59 renderer: render_readonly | |
60 }); | |
59 mfields.push(new Ext.data.Field({name: 'readonly'})); | 61 mfields.push(new Ext.data.Field({name: 'readonly'})); |
60 for (var i = cols.length - 1; i >= 0; i--){ | 62 for (var i = cols.length - 1; i >= 0; i--){ |
61 rcols.push(cols[i]); | 63 rcols.push(cols[i]); |
62 mfields.push(new Ext.data.Field({name: cols[i].dataIndex})); | 64 mfields.push(new Ext.data.Field({ |
65 name: cols[i].dataIndex | |
66 })); | |
63 } | 67 } |
64 this.store.model.setFields(mfields); | 68 this.store.model.setFields(mfields); |
65 this.reconfigure(this.store, rcols); | 69 this.reconfigure(this.store, rcols); |
66 } | 70 } |
67 }); | 71 }); |