Skip to content

Commit

Permalink
paging
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenrikoverland committed Feb 28, 2017
1 parent a997f8c commit 89fc5bf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "26.0.0",
"name": "DHIS 2 Event Reports",
"name": "Event reports app",
"description": "DHIS2 event reports app",
"icons": {},
"developer": {
Expand Down
8 changes: 5 additions & 3 deletions src/api/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@ Layout.prototype.req = function(source, format, isSorted, isTableLayout, isFilte
}

// paging
if (this.dataType === dimensionConfig.dataType['individual_cases'] && isObject(this.paging)) {
request.add('pageSize=' + this.paging.pageSize);
request.add('page=' + this.paging.page);
if (this.dataType === dimensionConfig.dataType['individual_cases']) {
var paging = this.paging || {};

request.add('pageSize=' + (paging.pageSize || 100));
request.add('page=' + (paging.page || 1));
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ manifestReq.done(function(text) {
appManager.manifest = JSON.parse(text);
appManager.env = process.env.NODE_ENV;
appManager.setAuth();
//appManager.logVersion();
appManager.logVersion();

var systemInfoReq = $.getJSON(appManager.getApiPath() + systemInfoUrl);

Expand Down Expand Up @@ -230,6 +230,7 @@ function initialize() {

var createEventDataTable = function(layout, response) {
var _table = new table.EventDataTable(refs, layout, response);
var statusBar = uiManager.get('statusBar');

if (_table) {

Expand All @@ -243,6 +244,10 @@ function initialize() {
// events
tableManager.setColumnHeaderMouseHandlers(_layout, _table);

if (statusBar) {
statusBar.setStatus(layout, response);
}

afterLoad();
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/manager/InstanceManager.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {InstanceManager} from 'd2-analysis';
import { InstanceManager } from 'd2-analysis';

export {InstanceManager};
export { InstanceManager };

InstanceManager.prototype.getReport = function(layout, isFavorite, skipState, forceUiState, fn) {
var t = this,
Expand Down

0 comments on commit 89fc5bf

Please sign in to comment.