@ardimedia/angular-portal-azure 0.2.66 → 0.2.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/apn.d.ts +3 -3
  2. package/apn.js +34 -33
  3. package/package.json +1 -1
package/apn.d.ts CHANGED
@@ -333,11 +333,11 @@ declare namespace angularportalazure {
333
333
  }
334
334
  declare namespace angularportalazure {
335
335
  class BladeGrid extends angularportalazure.BladeData {
336
+ getItemsFunction: any;
336
337
  items: any[];
337
- constructor(portalService: angularportalazure.PortalService, path: string, title: string, subtitle?: string, width?: number);
338
+ constructor(portalService: angularportalazure.PortalService, path: string, title: string, subtitle: string, width: number, getItemsFunction: any);
338
339
  activate(): void;
339
- onActivate(): angular.IHttpPromise<any>;
340
- loadItems(f: any): void;
340
+ loadItems(func: () => any): void;
341
341
  onFilter(actual: Object, expected: string): boolean;
342
342
  /** Obsolete */
343
343
  setObsoleteLayoutProperites(): void;
package/apn.js CHANGED
@@ -1224,10 +1224,11 @@ var angularportalazure;
1224
1224
  __extends(BladeGrid, _super);
1225
1225
  //#endregion
1226
1226
  //#region Constructor
1227
- function BladeGrid(portalService, path, title, subtitle, width) {
1227
+ function BladeGrid(portalService, path, title, subtitle, width, getItemsFunction) {
1228
1228
  if (subtitle === void 0) { subtitle = ''; }
1229
1229
  if (width === void 0) { width = 200; }
1230
1230
  var _this = _super.call(this, portalService, path, title, subtitle, width) || this;
1231
+ _this.getItemsFunction = getItemsFunction;
1231
1232
  //#region Properties
1232
1233
  _this.items = [];
1233
1234
  angularportalazure.Debug.write('[angularportalazure-debug] \'BladeGrid\' constructor called.', [_this, portalService, path, title, subtitle, width]);
@@ -1238,46 +1239,46 @@ var angularportalazure;
1238
1239
  //#endregion
1239
1240
  //#region Methods
1240
1241
  BladeGrid.prototype.activate = function () {
1241
- angularportalazure.Debug.write('[angularportalazure-debug] \'BladeGrid.activate\' called.', [this]);
1242
- console.log('BladeGrid.activate()');
1242
+ var _this = this;
1243
+ this.loadItems(function () { return _this.getItemsFunction; });
1244
+ //angularportalazure.Debug.write('[angularportalazure-debug] \'BladeGrid.activate\' called.', [this]);
1245
+ //console.log('BladeGrid.activate()');
1246
+ //var that = this;
1247
+ //that.statusbar = 'Daten laden...';
1248
+ //that.statusbarClass = '';
1249
+ ////var onActivate = that.onActivate();
1250
+ ////if (that.onActivate === null || that.onActivate === undefined) {
1251
+ ////} else {
1252
+ // //that.loadItems(onActivate);
1253
+ // console.log('call onActivate()');
1254
+ // that.onActivate()
1255
+ // .then(function (data: any) {
1256
+ // console.log('OK');
1257
+ // that.items = data;
1258
+ // that.statusbar = '';
1259
+ // that.statusbarClass = '';
1260
+ // }).catch(function (exception: angularportalazure.Exception) {
1261
+ // console.log('exception');
1262
+ // console.log(exception);
1263
+ // that.statusbar = 'FEHLER: ' + exception.Message;
1264
+ // that.statusbarClass = 'message-info message-off';
1265
+ // });
1266
+ ////}
1267
+ };
1268
+ //onActivate(): angular.IHttpPromise<any> { // any should be: angular.IHttpPromise<any>
1269
+ // throw new Error('[angularportalazure.BladeGrid] \'onActivate\' is an abstract function. Define one in the derived class.');
1270
+ //}
1271
+ BladeGrid.prototype.loadItems = function (func) {
1243
1272
  var that = this;
1244
1273
  that.statusbar = 'Daten laden...';
1245
1274
  that.statusbarClass = '';
1246
- //var onActivate = that.onActivate();
1247
- //if (that.onActivate === null || that.onActivate === undefined) {
1248
- //} else {
1249
- //that.loadItems(onActivate);
1250
- console.log('call onActivate()');
1251
- that.onActivate()
1252
- .then(function (data) {
1253
- console.log('OK');
1275
+ func().then(function (data) {
1254
1276
  that.items = data;
1255
1277
  that.statusbar = '';
1256
1278
  that.statusbarClass = '';
1257
1279
  }).catch(function (exception) {
1258
- console.log('exception');
1259
- console.log(exception);
1260
1280
  that.statusbar = 'FEHLER: ' + exception.Message;
1261
- that.statusbarClass = 'message-info message-off';
1262
- });
1263
- //}
1264
- };
1265
- BladeGrid.prototype.onActivate = function () {
1266
- throw new Error('[angularportalazure.BladeGrid] \'onActivate\' is an abstract function. Define one in the derived class.');
1267
- };
1268
- BladeGrid.prototype.loadItems = function (f) {
1269
- var that = this;
1270
- console.log('loadItems');
1271
- console.log(f);
1272
- f().then(function (data) {
1273
- that.items = data;
1274
- that.statusbar = '';
1275
- that.statusbarClass = '';
1276
- }).catch(function (exception) {
1277
- console.log('loadItems.catch');
1278
- console.log(exception);
1279
- that.statusbar = 'FEHLER: ' + exception.Message;
1280
- that.statusbarClass = 'message-info message-off';
1281
+ that.statusbarClass = 'message-error message-off';
1281
1282
  });
1282
1283
  };
1283
1284
  //#region Filter
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ardimedia/angular-portal-azure",
3
3
  "description": "Angular Portal Azure - GUI Framework.",
4
4
  "author": "Ardimedia Anstalt <info@ardimedia.com> (http://www.ardimedia.com)",
5
- "version": "0.2.66",
5
+ "version": "0.2.68",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {