# HG changeset patch # User Torsten Irländer # Date 1367241506 -7200 # Node ID 8e79bda4d55b09ec3905e5a10a7f5f21cde96520 # Parent 039584709fa76c359bdf30d6018c7d1711b9acc7 Added a list to select predefined SQL Statement for the Proben list. diff -r 039584709fa7 -r 8e79bda4d55b app.js --- a/app.js Mon Apr 29 15:10:43 2013 +0200 +++ b/app.js Mon Apr 29 15:18:26 2013 +0200 @@ -8,7 +8,7 @@ layout: 'fit', items: [ { - xtype: 'probenlist', + xtype: 'sqllist', title: 'Probenauswahlmaske' } ] @@ -17,6 +17,7 @@ // Define the controllers of the application. They will be initialized // first before the application "launch" function is called. controllers: [ - 'Proben' + 'Proben', + 'Sql' ] }); diff -r 039584709fa7 -r 8e79bda4d55b app/controller/Sql.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/controller/Sql.js Mon Apr 29 15:18:26 2013 +0200 @@ -0,0 +1,25 @@ +Ext.define('Lada.controller.Sql', { + extend: 'Ext.app.Controller', + views: [ + 'sql.List' + ], + init: function() { + console.log('Initialising the Sql controller'); + this.control({ + // CSS like selector to select element in the viewport. See + // ComponentQuery documentation for more details. + 'viewport > sqllist': { + // Map the "render" event to the given function. + render: this.onPanelRendered, + // Map Doubleclick on rows of the probenlist. + itemclick: this.selectSql + } + }); + }, + onPanelRendered: function() { + console.log('The panel was rendered'); + }, + selectSql: function(grid, record) { + console.log('Selected SQL ' + record.get('id')); + } +}); diff -r 039584709fa7 -r 8e79bda4d55b app/view/sql/List.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/view/sql/List.js Mon Apr 29 15:18:26 2013 +0200 @@ -0,0 +1,25 @@ +Ext.define('Lada.view.sql.List' ,{ + extend: 'Ext.grid.Panel', + alias: 'widget.sqllist', + + title: 'SQL-Auswahl', + + initComponent: function() { + this.store = { + fields: ['id', 'name', 'description', 'sql'], + data : [ + {'id': '1', 'name': 'MST, UWB', 'description': 'Beschreibung der MST, UWB Abfrage', 'sql': 'select * from xxx'}, + {'id': '2', 'name': 'Rbegin', 'description': 'Beschreibung der Rbegin Abfrage', 'sql': 'select * from xxx'} + ] + }; + + this.columns = [ + {header: 'ID', dataIndex: 'id', flex: 1}, + {header: 'Kurzname', dataIndex: 'name', flex: 1}, + {header: 'SQL', dataIndex: 'desc', flex: 1} + ]; + + this.callParent(arguments); + } +}); +