Commit 065db7ff authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Added ability to specify service panel ID

* Better support for getting the contents of the windows instead of using internal properties
parent d0658174
......@@ -99,7 +99,7 @@ Ext.extend(Ext.ux.JsonStore, Ext.data.JsonStore, {
// Create a generic window and specify the window, form and submission ajax configuration
Ext.ux.GenericFormWindow = function(windowConfig,formConfig,submitAjaxConfig) {
var panelID = Ext.id();
var panelID = formConfig.formPanelID ? formConfig.formPanelID : Ext.id();
var windowID = Ext.id();
......@@ -186,22 +186,27 @@ Ext.ux.GenericFormWindow = function(windowConfig,formConfig,submitAjaxConfig) {
}
// Apply our own window configuration
var formPanel = new Ext.ux.ProgressFormPanel(formConfig,submitAjaxConfig);
windowConfig = Ext.apply({
id: windowID,
layout: 'fit',
items: [
new Ext.ux.ProgressFormPanel(formConfig,submitAjaxConfig)
formPanel
]
}, windowConfig);
// Set grid panel ID
this.formPanelID = panelID;
this.formPanel = formPanel;
Ext.Window.superclass.constructor.call(this, windowConfig);
}
Ext.extend(Ext.ux.GenericFormWindow, Ext.Window, {
// Override functions here
getFormPanel: function() {
return this.formPanel;
}
});
......@@ -282,11 +287,12 @@ Ext.ux.GenericGridWindow = function(windowConfig,gridConfig,storeConfig,filtersC
});
// Apply our own window configuration
var gridPanel = new Ext.grid.GridPanel(gridConfig);
windowConfig = Ext.apply({
id: windowID,
layout: 'fit',
items: [
new Ext.grid.GridPanel(gridConfig)
gridPanel
]
}, windowConfig);
......@@ -299,6 +305,7 @@ Ext.ux.GenericGridWindow = function(windowConfig,gridConfig,storeConfig,filtersC
// Set grid panel ID
this.gridPanelID = panelID;
this.gridPanel = gridPanel;
Ext.Window.superclass.constructor.call(this, windowConfig);
}
......@@ -316,6 +323,10 @@ Ext.extend(Ext.ux.GenericGridWindow, Ext.Window, {
limit: 25
}
});
},
getGridPanel: function() {
return this.formPanel;
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment