Changeset 1202
- Timestamp:
- 07/02/09 07:04:15 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer.js
r1201 r1202 683 683 var firstSource = this.layerSources.getAt(0); 684 684 685 var capGrid Config ={685 var capGridPanel = new GeoExplorer.CapabilitiesGrid({ 686 686 store: firstSource.data.store, 687 687 mapPanel : this.mapPanel, … … 695 695 } 696 696 } 697 }; 698 699 var capGridPanel = new GeoExplorer.CapabilitiesGrid(capGridConfig); 700 var baseCapGridPanel = new GeoExplorer.CapabilitiesGrid(capGridConfig); 701 702 var sourceComboConfig = { 697 }); 698 699 var sourceComboBox = new Ext.form.ComboBox({ 703 700 store: this.layerSources, 704 701 valueField: "identifier", … … 709 706 forceSelection: true, 710 707 mode: "local", 711 value: firstSource.data.identifier 712 }; 713 714 var sourceComboBox = new Ext.form.ComboBox(sourceComboConfig); 715 sourceComboBox.on("select", function(combo, record, index) { 716 capGridPanel.reconfigure(record.data.store, capGridPanel.getColumnModel()); 717 }, this); 718 719 var baseSourceComboBox = new Ext.form.ComboBox(sourceComboConfig); 720 baseSourceComboBox.on("select", function(combo, record, index) { 721 capGridPanel.reconfigure(record.data.store, baseCapGridPanel.getColumnModel()); 722 }, this); 708 value: firstSource.data.identifier, 709 listeners: { 710 select: function(combo, record, index) { 711 capGridPanel.reconfigure(record.data.store, capGridPanel.getColumnModel()); 712 }, 713 scope: this 714 } 715 }); 723 716 724 717 var capGridToolbar = null; 725 var baseCapGridToolbar = null;726 718 727 719 if (this.proxy || this.layerSources.getCount() > 1) { … … 732 724 sourceComboBox 733 725 ]; 734 baseCapGridToolbar = [735 new Ext.Toolbar.TextItem({736 text: "View available data from:"737 }),738 baseSourceComboBox739 ];740 726 } 741 727 742 728 if (this.proxy) { 743 729 capGridToolbar.push(new Ext.Button({ 744 text: "or add a new server.",745 handler: function() {746 newSourceWindow.show();747 }748 }));749 baseCapGridToolbar.push(new Ext.Button({750 730 text: "or add a new server.", 751 731 handler: function() { … … 815 795 } 816 796 }); 817 818 this.baseCapGrid = new Ext.Window({819 title: "Available Base Layers",820 closeAction: 'hide',821 layout: 'border',822 height: 300,823 width: 600,824 modal: true,825 items: [826 baseCapGridPanel827 ],828 tbar: baseCapGridToolbar,829 bbar: [830 "->",831 new Ext.Button({832 text: "Add Base Layers",833 iconCls: "icon-addlayers",834 handler: function(){835 baseCapGridPanel.addLayers(true);836 },837 scope : this838 }),839 new Ext.Button({840 text: "Done",841 handler: function() {842 this.baseCapGrid.hide();843 },844 scope: this845 })846 ]847 });848 797 849 },850 851 /** private: method[showCapabilitiesGrid]852 * Shows the window with a capabilities grid.853 */854 showBaseCapabilitiesGrid: function() {855 if(!this.capGrid) {856 this.initCapGrid();857 }858 this.baseCapGrid.show();859 798 }, 860 799