dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #29408
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14851: Minor fix.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 14851 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-04-14 16:04:09 +0200
message:
Minor fix.
modified:
dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js 2014-04-14 13:39:25 +0000
+++ dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js 2014-04-14 14:02:43 +0000
@@ -2048,19 +2048,23 @@
windowCmpWidth = windowWidth - 14;
ns.app.stores.eventReport.on('load', function(store, records) {
- var pager = store.proxy.reader.jsonData.pager;
-
- info.setText('Page ' + pager.page + ' of ' + pager.pageCount);
-
- prevButton.enable();
- nextButton.enable();
-
- if (pager.page === 1) {
- prevButton.disable();
- }
-
- if (pager.page === pager.pageCount) {
- nextButton.disable();
+ var pager;
+
+ if (store.proxy.reader && store.proxy.reader.jsonData && store.proxy.reader.jsonData.pager) {
+ pager = store.proxy.reader.jsonData.pager;
+
+ info.setText('Page ' + pager.page + ' of ' + pager.pageCount);
+
+ prevButton.enable();
+ nextButton.enable();
+
+ if (pager.page === 1) {
+ prevButton.disable();
+ }
+
+ if (pager.page === pager.pageCount) {
+ nextButton.disable();
+ }
}
});