reader: {
type: 'json',
root: 'data'
+ },
+ afterRequest: function(request, success) {
+ me.fireEvent('afterload', me, request, success);
+ return;
}
});
});
Ext.applyIf(me, {
- url: "/api2/extjs/cluster/options",
+ url: "/api2/json/cluster/options",
cwidth1: 130,
interval: 1000,
selModel: sm,
me.mon(rstore, 'beforeload', function(s, operation, eOpts) {
if (!load_count) {
me.setLoading(true);
- }
+ }
});
- me.mon(rstore, 'load', function(s, records, success) {
-
+ me.mon(rstore.proxy, 'afterload', function(proxy, request, success) {
load_count++;
-
me.setLoading(false);
- if (!success) {
- me.setLoading("Data load error");
+ if (success) {
return;
- }
+ }
+
+ var msg;
+ var operation = request.operation;
+ var error = operation.getError();
+ if (error.statusText) {
+ msg = error.statusText + ' (' + error.status + ')';
+ } else {
+ msg = gettext('Connection error');
+ }
+ me.setLoading(msg);
});
Ext.applyIf(me, {
me.mon(store, 'datachanged', set_button_status);
- me.mon(rstore, 'load', function(s, records, success) {
- if (!success) {
- me.setLoading("Data load error");
+ var load_count = 0;
+
+ me.mon(rstore, 'beforeload', function(s, operation, eOpts) {
+ if (!load_count) {
+ me.setLoading(true);
+ }
+ });
+
+ me.mon(rstore.proxy, 'afterload', function(proxy, request, success) {
+ load_count++;
+ me.setLoading(false);
+
+ if (success) {
return;
+ }
+
+ var msg;
+ var operation = request.operation;
+ var error = operation.getError();
+ if (error.statusText) {
+ msg = error.statusText + ' (' + error.status + ')';
} else {
- me.setLoading(false);
+ msg = gettext('Connection error');
}
+ me.setLoading(msg);
});
Ext.apply(me, {