Skip to content

Commit 811caa1

Browse files
author
Kyle Morse
committed
Fix export sort order
1 parent bab0916 commit 811caa1

File tree

5 files changed

+1377
-13
lines changed

5 files changed

+1377
-13
lines changed

deploy/App.txt

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<head>
44
<title>Custom Grid with Deep Export</title>
55
<!-- (c) 2015 Rally Software Development Corp. All Rights Reserved. -->
6-
<!-- Build Date: Tue May 23 2017 15:16:51 GMT-0600 (MDT) -->
6+
<!-- Build Date: Tue May 01 2018 15:05:30 GMT-0600 (MDT) -->
77

88
<script type="text/javascript">
9-
var APP_BUILD_DATE = "Tue May 23 2017 15:16:51 GMT-0600 (MDT)";
10-
var CHECKSUM = 33370645756;
9+
var APP_BUILD_DATE = "Tue May 01 2018 15:05:30 GMT-0600 (MDT)";
10+
var CHECKSUM = 34208422465;
1111
</script>
1212

1313
<script type="text/javascript" src="/apps/2.1/sdk.js"></script>
@@ -512,6 +512,7 @@ Ext.define('Rally.technicalservices.HierarchyLoader',{
512512
filters: undefined,
513513
fetch: undefined,
514514
childModels: undefined,
515+
sorters: undefined,
515516

516517
maxParallelCalls: 6,
517518

@@ -522,6 +523,7 @@ Ext.define('Rally.technicalservices.HierarchyLoader',{
522523
this.fetch = config.fetch || [];
523524
this.filters = config.filters || [];
524525
this.loadChildModels = config.loadChildModels || [];
526+
this.sorters = config.sorters || [];
525527
},
526528
load: function(){
527529

@@ -590,7 +592,8 @@ Ext.define('Rally.technicalservices.HierarchyLoader',{
590592
var config = {
591593
model: this.model,
592594
fetch: fetch,
593-
filters: this.filters
595+
filters: this.filters,
596+
sorters: this.sorters
594597
};
595598
this.logger.log('fetchRoot config', config);
596599

@@ -660,6 +663,10 @@ Ext.define('Rally.technicalservices.HierarchyLoader',{
660663
config = {
661664
model: type,
662665
fetch: fetch,
666+
sorters: [
667+
{ property: 'TaskIndex', direction: 'ASC'},
668+
{ property: 'DragAndDropRank', direction: 'ASC'}
669+
],
663670
filters: Rally.data.wsapi.Filter.or(filters),
664671
context: {project: null}
665672
};
@@ -1063,15 +1070,18 @@ Ext.define("custom-grid-with-deep-export", {
10631070
}
10641071
return fetch;
10651072
},
1073+
_getExportSorters: function(){
1074+
return this.down('rallygridboard').getGridOrBoard().getStore().getSorters();
1075+
},
10661076
_export: function(args){
1067-
10681077
var columns = this._getExportColumns(),
10691078
fetch = this._getExportFetch(),
10701079
filters = this._getExportFilters(),
10711080
modelName = this.modelNames[0],
1072-
childModels = args.childModels;
1081+
childModels = args.childModels,
1082+
sorters = this._getExportSorters();
10731083

1074-
this.logger.log('_export', fetch, args, columns, filters.toString(), childModels);
1084+
this.logger.log('_export', fetch, args, columns, filters.toString(), childModels, sorters);
10751085

10761086
var exporter = Ext.create('Rally.technicalservices.HierarchyExporter', {
10771087
fileName: 'hierarchy-export.csv',
@@ -1087,6 +1097,7 @@ Ext.define("custom-grid-with-deep-export", {
10871097
model: modelName,
10881098
fetch: fetch,
10891099
filters: filters,
1100+
sorters: sorters,
10901101
loadChildModels: childModels,
10911102
portfolioItemTypes: this.portfolioItemTypes,
10921103
context: this.getContext().getDataContext()

0 commit comments

Comments
 (0)