Skip to content

Commit

Permalink
Merge pull request #651 from cmv/feature/print-results-order
Browse files Browse the repository at this point in the history
Allow option for print results to sort from newest to oldest.
  • Loading branch information
DavidSpriggs authored Dec 18, 2016
2 parents cfd44b2 + 92fb2d1 commit 5276b6c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions viewer/js/gis/dijit/Print.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ define([
'dojo/dom-style',
'dojo/dom-construct',
'dojo/dom-class',
'dojo/date/locale',
'dojo/text!./Print/templates/Print.html',
'dojo/text!./Print/templates/PrintResult.html',
'esri/tasks/PrintTemplate',
Expand All @@ -31,7 +32,7 @@ define([
'dijit/TooltipDialog',
'dijit/form/RadioButton',
'xstyle/css!./Print/css/Print.css'
], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, PrintTask, Memory, lang, array, topic, Style, domConstruct, domClass, printTemplate, printResultTemplate, PrintTemplate, PrintParameters, esriRequest, urlUtils, i18n) {
], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, PrintTask, Memory, lang, array, topic, Style, domConstruct, domClass, locale, printTemplate, printResultTemplate, PrintTemplate, PrintParameters, esriRequest, urlUtils, i18n) {

// Print result dijit
var PrintResultDijit = declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
Expand All @@ -40,6 +41,8 @@ define([
i18n: i18n,
url: null,
fileHandle: null,
resultOrder: 'last', // first or last

postCreate: function () {
this.inherited(arguments);
this.fileHandle.then(lang.hitch(this, '_onPrintComplete'), lang.hitch(this, '_onPrintError'));
Expand Down Expand Up @@ -229,9 +232,9 @@ define([
count: this.count.toString(),
icon: (form.format === 'PDF') ? this.pdfIcon : this.imageIcon,
docName: form.title,
title: form.format + ', ' + form.layout,
title: form.format + ', ' + form.layout + ', ' + locale.format(new Date(), {formatLength: 'short'}),
fileHandle: fileHandle
}).placeAt(this.printResultsNode, 'last');
}).placeAt(this.printResultsNode, this.resultOrder);

if (this.printTask.async) {
result.own(this.printTask.printGp.on('status-update', lang.hitch(result, '_handleStatusUpdate')));
Expand Down

0 comments on commit 5276b6c

Please sign in to comment.