# HG changeset patch # User Torsten Irländer # Date 1368008406 -7200 # Node ID f964a50bfe57af1a4dcc4a0a35176ee23853a1cf # Parent 72778ac34dbbee0147aa8d8fa015b4200d3212a9 Restructured the application. Fixed layouts etc. diff -r 72778ac34dbb -r f964a50bfe57 app.js --- a/app.js Tue May 07 17:20:11 2013 +0200 +++ b/app.js Wed May 08 12:20:06 2013 +0200 @@ -2,61 +2,10 @@ name: 'Lada', // Setting this variable to true should trigger loading the Viewport.js // file which sets ob the viewport. But this does not happen. - autoCreateViewprt: false, + autoCreateViewport: true, launch: function() { // Start the application. console.log('Launching the application'); - - // This code works here, but this should usually be done in the - // Viewport.js class. - Ext.create('Ext.panel.Panel', { - renderTo: Ext.getBody(), - title: '
Probenauswahlmaske
', - items:[ - { - xtype: 'panel', - id: 'searchSelection', - border: false, - items: [ - // 1. SQL-Selection - // 1.1 Just a small texttual field - { - xtype: 'displayfield', - padding : '10 0', - fieldLabel: 'SQL-Auswahl' - }, - // 1.2 Selection of prepared sql statements - { - xtype: 'sqllist' - } - ] - }, - { - xtype: 'panel', - id: 'searchVariables', - hidden: true, - border: false, - items: [ - // 2. Variable-Definition. Depending on the SQL-Selection we - // need to show a small form to be able to diefine some values - // within the preselected Search-statement. - // 2.1 Just a small texttual field - { - xtype: 'displayfield', - padding : '10 0', - fieldLabel: 'Variablenbelegung (Zeiten in UTC)', - labelWidth: 500 - } - - ] - }, - { - xtype: 'probenlist', - id: 'searchResult', - hidden: true, - } - ] - }); }, // Define the controllers of the application. They will be initialized // first before the application "launch" function is called. diff -r 72778ac34dbb -r f964a50bfe57 app/controller/Sql.js --- a/app/controller/Sql.js Tue May 07 17:20:11 2013 +0200 +++ b/app/controller/Sql.js Wed May 08 12:20:06 2013 +0200 @@ -24,26 +24,28 @@ }, selectSql: function(grid, record) { var selection = record.get('id'); - var variables = Ext.getCmp('searchVariables'); - console.log('Selected SQL' + selection); - // Set correct form for the current SQL-Selection - console.log('Length is ' + variables.items.length); - if (variables.items.length > 1) { - console.log('Length is > than 1'); - variables.remove(currentVar.id); - } - if (selection == 1) { - currentVar = variables1; - } - else { - currentVar = variables2; - } - variables.add(currentVar); - // Show the panel for the variable definiton. - variables.show(); + var variables = Ext.getCmp('variables'); + var result = Ext.getCmp('result'); + console.log('Selected SQL ' + selection); + //// Set correct form for the current SQL-Selection + //console.log('Length is ' + variables.items.length); + //if (variables.items.length > 1) { + // console.log('Length is > than 1'); + // variables.remove(currentVar.id); + //} + //if (selection == 1) { + // currentVar = variables1; + //} + //else { + // currentVar = variables2; + //} + //variables.add(currentVar); + //// Show the panel for the variable definiton. + //variables.show(); // Show the results. - Ext.getCmp('searchResult').show(); + result.getStore().load(); + result.show(); } }); diff -r 72778ac34dbb -r f964a50bfe57 app/store/Proben.js --- a/app/store/Proben.js Tue May 07 17:20:11 2013 +0200 +++ b/app/store/Proben.js Wed May 08 12:20:06 2013 +0200 @@ -7,8 +7,7 @@ read: 'server/rest/proben' }, reader: { - type: 'json', - contentType: "application/json; charset=utf-8;" + type: 'json' } } }); diff -r 72778ac34dbb -r f964a50bfe57 app/view/Viewport.js --- a/app/view/Viewport.js Tue May 07 17:20:11 2013 +0200 +++ b/app/view/Viewport.js Wed May 08 12:20:06 2013 +0200 @@ -1,17 +1,32 @@ Ext.define('Lada.view.Viewport' ,{ extend: 'Ext.container.Viewport', requires: [ - 'Lada.view.Sql', - 'Lada.view.Proben' + 'Lada.view.sql.List', + 'Lada.view.sql.Variables', + 'Lada.view.proben.List' ], - layout: 'fit', initComponent: function() { console.log('Setting up Viewport'); this.items = { - xtype: 'probenlist' - //items: [{ - // xtype: 'probenlist' - //}] + xtype: 'panel', + title: '
Probenauswahlmaske
', + bodyPadding: '10 10', + items: [ + { + xtype: 'sqllist', + margin: '0 0 10 0' + }, + // Variables settings for the current selected sql statement. + //{ + // id: 'variables', + // xtype: 'variables' + //}, + // Resultlist for the query. + { + id: 'result', + xtype: 'probenlist' + } + ] }; this.callParent(arguments); } diff -r 72778ac34dbb -r f964a50bfe57 app/view/proben/Edit.js --- a/app/view/proben/Edit.js Tue May 07 17:20:11 2013 +0200 +++ b/app/view/proben/Edit.js Wed May 08 12:20:06 2013 +0200 @@ -3,15 +3,19 @@ alias: 'widget.probenedit', title: 'Maske für §3-Proben', - width: 800, - layout: 'fit', + width: 600, + height: 600, autoShow: true, + autoScroll: true, + modal: true, initComponent: function() { this.items = [ { //Define the form xtype: 'form', + bodyPadding: '10 10', + border: 0, items: [ // Probenangaben { diff -r 72778ac34dbb -r f964a50bfe57 app/view/proben/List.js --- a/app/view/proben/List.js Tue May 07 17:20:11 2013 +0200 +++ b/app/view/proben/List.js Wed May 08 12:20:06 2013 +0200 @@ -1,8 +1,8 @@ Ext.define('Lada.view.proben.List' ,{ extend: 'Ext.grid.Panel', alias: 'widget.probenlist', + maxHeight: 350, store: 'Proben', - initComponent: function() { this.columns = [ {header: 'Datenbasis', dataIndex: 'datenbasisId', width: 70}, diff -r 72778ac34dbb -r f964a50bfe57 app/view/sql/List.js --- a/app/view/sql/List.js Tue May 07 17:20:11 2013 +0200 +++ b/app/view/sql/List.js Wed May 08 12:20:06 2013 +0200 @@ -13,4 +13,3 @@ this.callParent(arguments); } }); - diff -r 72778ac34dbb -r f964a50bfe57 app/view/sql/Variables.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/view/sql/Variables.js Wed May 08 12:20:06 2013 +0200 @@ -0,0 +1,23 @@ +Ext.define('Lada.view.sql.Variables' ,{ + extend: 'Ext.panel.Panel', + alias: 'widget.variables', + border: false, + + initComponent: function() { + this.items = [ + { + id: 'sqlVar1', + xtype: 'displayfield', + fieldLabel: 'Variables for SQL 1', + labelWidth: 300 + }, + { + id: 'sqlVar2', + xtype: 'displayfield', + fieldLabel: 'Variables for SQL 2', + labelWidth: 300 + } + ]; + this.callParent(arguments); + } +});