# HG changeset patch # User Torsten Irländer # Date 1368719753 -7200 # Node ID 4d60b9ebce15ec316ed8b04b26593372db115f54 # Parent e02d07abc4fecf69599035b31750f543d1ae043c Renamed sql modul into search. Further display The query selection as Combobox instead of a grid. diff -r e02d07abc4fe -r 4d60b9ebce15 app/controller/Sql.js --- a/app/controller/Sql.js Fri May 10 12:24:45 2013 +0200 +++ b/app/controller/Sql.js Thu May 16 17:55:53 2013 +0200 @@ -1,7 +1,7 @@ Ext.define('Lada.controller.Sql', { extend: 'Ext.app.Controller', views: [ - 'sql.List' + 'search.List' ], stores: [ 'Sql' @@ -11,19 +11,20 @@ this.control({ // CSS like selector to select element in the viewport. See // ComponentQuery documentation for more details. - 'sqllist': { + 'queryselector': { // Map the "render" event to the given function. render: this.onPanelRendered, // Map Doubleclick on rows of the probenlist. - itemclick: this.selectSql + select: this.selectSql } }); }, onPanelRendered: function() { console.log('The panel was rendered'); }, - selectSql: function(grid, record) { - var selection = record.get('id'); + selectSql: function(element, record, index) { + //var selection = record.get('id'); + var selection = index; var variables = Ext.getCmp('variables'); var result = Ext.getCmp('result'); console.log('Selected SQL ' + selection); @@ -44,7 +45,9 @@ //variables.show(); // Show the results. + console.log('Loading store'); result.getStore().load(); + console.log('Store loaded'); result.show(); } }); diff -r e02d07abc4fe -r 4d60b9ebce15 app/store/Proben.js --- a/app/store/Proben.js Fri May 10 12:24:45 2013 +0200 +++ b/app/store/Proben.js Thu May 16 17:55:53 2013 +0200 @@ -4,7 +4,7 @@ proxy: { type: 'ajax', api: { - read: 'server/rest/proben' + read: 'server/rest/proben' }, reader: { type: 'json' diff -r e02d07abc4fe -r 4d60b9ebce15 app/view/Viewport.js --- a/app/view/Viewport.js Fri May 10 12:24:45 2013 +0200 +++ b/app/view/Viewport.js Thu May 16 17:55:53 2013 +0200 @@ -1,8 +1,8 @@ Ext.define('Lada.view.Viewport' ,{ extend: 'Ext.container.Viewport', requires: [ - 'Lada.view.sql.List', - 'Lada.view.sql.Variables', + 'Lada.view.search.List', + 'Lada.view.search.Variables', 'Lada.view.proben.List' ], initComponent: function() { @@ -13,7 +13,7 @@ bodyPadding: '10 10', items: [ { - xtype: 'sqllist', + xtype: 'queryselector', margin: '0 0 10 0' }, // Variables settings for the current selected sql statement. diff -r e02d07abc4fe -r 4d60b9ebce15 app/view/search/List.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/view/search/List.js Thu May 16 17:55:53 2013 +0200 @@ -0,0 +1,31 @@ +Ext.define('Lada.view.search.List' ,{ + extend: 'Ext.form.ComboBox', + alias: 'widget.queryselector', + store: 'Sql', + displayField:'name', + valueField: 'id' , + emptyText:'Wählen Sie eine Abfrage', + //typeAhead: true, + //mode: 'local', + //triggerAction: 'all', + //selectOnFocus:true, + + initComponent: function() { + this.callParent(arguments); + } +}); +//Ext.define('Lada.view.search.List' ,{ +// extend: 'Ext.grid.Panel', +// alias: 'widget.queryselector', +// store: 'Sql', +// +// initComponent: function() { +// this.columns = [ +// {header: 'ID', dataIndex: 'id', flex: 1}, +// {header: 'Kurzname', dataIndex: 'name', flex: 1}, +// {header: 'SQL', dataIndex: 'desc', flex: 1} +// ]; +// +// this.callParent(arguments); +// } +//}); diff -r e02d07abc4fe -r 4d60b9ebce15 app/view/search/Variables.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/view/search/Variables.js Thu May 16 17:55:53 2013 +0200 @@ -0,0 +1,23 @@ +Ext.define('Lada.view.search.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); + } +}); diff -r e02d07abc4fe -r 4d60b9ebce15 app/view/sql/List.js --- a/app/view/sql/List.js Fri May 10 12:24:45 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -Ext.define('Lada.view.sql.List' ,{ - extend: 'Ext.grid.Panel', - alias: 'widget.sqllist', - store: 'Sql', - - initComponent: function() { - this.columns = [ - {header: 'ID', dataIndex: 'id', flex: 1}, - {header: 'Kurzname', dataIndex: 'name', flex: 1}, - {header: 'SQL', dataIndex: 'desc', flex: 1} - ]; - - this.callParent(arguments); - } -}); diff -r e02d07abc4fe -r 4d60b9ebce15 app/view/sql/Variables.js --- a/app/view/sql/Variables.js Fri May 10 12:24:45 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -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); - } -});