comparison app/view/proben/List.js @ 348:6007d11b81c2

Added documentation
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 13 Aug 2013 11:34:47 +0200
parents 62e92e470a1e
children b8bd8d9a93ab
comparison
equal deleted inserted replaced
347:1536fb5c81b7 348:6007d11b81c2
1 /*
2 * Grid to list Proben
3 */
1 Ext.define('Lada.view.proben.List' ,{ 4 Ext.define('Lada.view.proben.List' ,{
2 extend: 'Ext.grid.Panel', 5 extend: 'Ext.grid.Panel',
3 alias: 'widget.probenlist', 6 alias: 'widget.probenlist',
4 store: 'Proben', 7 store: 'Proben',
5 viewConfig: { 8 viewConfig: {
37 } 40 }
38 ]; 41 ];
39 this.columns = []; 42 this.columns = [];
40 this.callParent(arguments); 43 this.callParent(arguments);
41 }, 44 },
45 /**
46 * Setup columns of the Grid dynamically based on a list of given cols.
47 * The function is called from the {@link Lada.controllers.Sql#selectSql
48 * select sql event}
49 * @parameter {Array} List of cols to show in the Grid.
50 */
42 setupColumns: function(cols) { 51 setupColumns: function(cols) {
43 var rcols = [] 52 var rcols = []
44 rcols.push({header: 'RW', dataIndex: 'readonly', width: 30, renderer: render_readonly}); 53 rcols.push({header: 'RW', dataIndex: 'readonly', width: 30, renderer: render_readonly});
45 for (var i = cols.length - 1; i >= 0; i--){ 54 for (var i = cols.length - 1; i >= 0; i--){
46 rcols.push(cols[i]); 55 rcols.push(cols[i]);
47 }; 56 };
48 this.reconfigure(this.store, rcols); 57 this.reconfigure(this.store, rcols);
49 } 58 }
50 }); 59 });
51 60
61 /**
62 * Helper function to render a readonly symbol per row in the grid
63 * @param {Boolean} flag if the symbol is a readonly symbol.
64 */
52 function render_readonly (value) { 65 function render_readonly (value) {
53 if (value) { 66 if (value) {
54 return '&#128274;' 67 return '&#128274;'
55 } else { 68 } else {
56 return '&#128275;' 69 return '&#128275;'

http://lada.wald.intevation.org