Window.js (1151B)
1 Ext.define("PartKeepr.Components.Widgets.ColumnConfigurator.Window", { 2 extend: "Ext.window.Window", 3 4 width: 800, 5 height: 400, 6 7 title: i18n("Configure Columns"), 8 9 layout: 'fit', 10 modal: true, 11 12 grid: null, 13 14 keepConfiguration: false, 15 16 initComponent: function () { 17 this.columnConfiguratorPanel = Ext.create("PartKeepr.Components.Widgets.ColumnConfigurator.Panel", { 18 grid: this.grid 19 }); 20 this.items = this.columnConfiguratorPanel; 21 this.callParent(arguments); 22 23 this.down("#apply").on("click", this.apply, this); 24 this.down("#cancel").on("click", this.doClose, this); 25 }, 26 apply: function () { 27 this.keepConfiguration = true; 28 this.close(); 29 }, 30 doClose: function (keepConfig) { 31 if (!this.keepConfiguration) 32 { 33 this.grid.reconfigure(this.grid.getStore(), this.columnConfiguratorPanel.originalColumnConfigurations); 34 } 35 this.callParent(arguments); 36 }, 37 applyColumnConfigurationFromGrid: function () { 38 this.columnConfiguratorPanel.applyColumnConfigurationFromGrid(this.grid); 39 } 40 });