Commit 335d3aed authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* StoreLoadException is now StoreException

* Mask window on store load
parent f1f1452f
// FIXME
function storeLoadException(requestConfig, storeObj, xmlEr, except) {
function storeException(requestConfig, storeObj, xmlEr, except) {
if (isset(xmlEr.response) && isset(xmlEr.response.errors)) {
// If this is a return object with errors, display them...
......@@ -164,11 +163,19 @@ Ext.ux.GenericGridWindow = function(windowConfig,gridConfig,storeConfig,filtersC
}, storeConfig);
var store = new Ext.ux.JsonStore(storeConfig);
store.on('loadexception', storeLoadException);
store.on('exception', storeException);
// Setup filters for the grid
var filters = new Ext.ux.grid.GridFilters(filtersConfig);
// Setup paging toolbar
var pagingToolbar = new Ext.PagingToolbar({
pageSize: 25,
store: store,
displayInfo: true,
plugins: filters
});
// Grid configuration
gridConfig = Ext.apply({
xtype: 'gridpanel',
......@@ -207,15 +214,20 @@ Ext.ux.GenericGridWindow = function(windowConfig,gridConfig,storeConfig,filtersC
buttonAlign: 'center',
// Bottom bar
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: store,
displayInfo: true,
plugins: filters
})
bbar: [
pagingToolbar
]
}, gridConfig);
// Store handling
store.on('beforeload', function() { var win = Ext.getCmp(windowID); win.getEl().mask("Loading..."); } );
store.on('load', function() { var win = Ext.getCmp(windowID); win.getEl().unmask(); } );
store.on('exception', function(thisobj, action, rs, params) {
var win = Ext.getCmp(windowID); win.getEl().unmask();
storeException(thisobj,action,rs,params);
});
// Apply our own window configuration
windowConfig = Ext.apply({
id: windowID,
......
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