'
].join(''))
});
@@ -177,6 +188,7 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
this.btnDown.on('click', _.bind(this.onMoveClick, this, false));
this.lblColumn = $('#sort-dialog-label-column');
+ this.lblSort = $('#sort-dialog-label-sort');
this.afterRender();
},
@@ -213,6 +225,7 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
this.sortList.on('item:add', _.bind(this.addControls, this));
this.sortList.on('item:change', _.bind(this.addControls, this));
this.refreshList(props.asc_getLevels());
+ this.initListHeaders();
}
},
@@ -278,6 +291,14 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
this.updateButtons();
},
+ initListHeaders: function() {
+ var pos = this.sortList.cmpEl.find('#sort-dialog-cmb-sort-0').position();
+ pos && this.lblColumn.width(Math.floor(pos.left)-3);
+ pos = this.sortList.cmpEl.find('#sort-dialog-btn-color-0').position();
+ !pos && (pos = this.sortList.cmpEl.find('#sort-dialog-cmb-order-0').position());
+ pos && this.lblSort.width(Math.floor(pos.left)-5 - this.lblColumn.width());
+ },
+
addControls: function(listView, itemView, item) {
if (!item) return;
@@ -360,6 +381,8 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
cmpEl.on('mousedown', '.combobox', function(){
me.sortList.selectRecord(item);
});
+
+ this.updateLevelCaptions(true);
},
onOptions: function () {
@@ -489,6 +512,7 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
this.sortList.scrollToRecord(rec);
}
this.updateMoveButtons();
+ this.updateLevelCaptions();
},
onSelectLevel: function(lisvView, itemView, record) {
@@ -608,6 +632,7 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
this.btnCopy.setDisabled(this.sortList.store.length<1);
this.btnDelete.setDisabled(this.sortList.store.length<1);
this.updateMoveButtons();
+ this.updateLevelCaptions(true);
this.sortList.scroller && this.sortList.scroller.update();
},
@@ -618,6 +643,17 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
this.btnDown.setDisabled(index<0 || index==this.sortList.store.length-1);
},
+ updateLevelCaptions: function(all) {
+ var captions = this.$window.find('.level-caption');
+ if (captions.length<1) return;
+
+ if (all)
+ captions.text(this.textThenBy);
+ else
+ (captions.length>1) && (captions[1].innerText = this.textThenBy);
+ captions[0].innerText = this.textSortBy;
+ },
+
onSelectOther: function(combo, item) {
var me = this;
if (me.api) {
@@ -688,7 +724,7 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
textLeft: 'Left',
textRight: 'Right',
errorEmpty: 'All sort criteria must have a column or row specified.',
- textAuto: 'Automatic',
+ textAuto: 'Auto',
textNone: 'None',
errorNotOriginalCol: 'The column you selected is not in the original selected range.',
errorNotOriginalRow: 'The row you selected is not in the original selected range.',
@@ -698,7 +734,8 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
textMoreRows: '(More rows...)',
textMoreCols: '(More columns...)',
errorSameColumnValue: "%1 is being sorted by values more than once. Delete the duplicate sort criteria and try again.",
- errorSameColumnColor: "%1 is being sorted by the same color more than once. Delete the duplicate sort criteria and try again."
-
+ errorSameColumnColor: "%1 is being sorted by the same color more than once. Delete the duplicate sort criteria and try again.",
+ textSortBy: 'Sort by',
+ textThenBy: 'Then by'
}, SSE.Views.SortDialog || {}));
});
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json
index a31103b5e..a67670234 100644
--- a/apps/spreadsheeteditor/main/locale/en.json
+++ b/apps/spreadsheeteditor/main/locale/en.json
@@ -2118,7 +2118,7 @@
"SSE.Views.SortDialog.textLeft": "Left",
"SSE.Views.SortDialog.textRight": "Right",
"SSE.Views.SortDialog.errorEmpty": "All sort criteria must have a column or row specified.",
- "SSE.Views.SortDialog.textAuto": "Automatic",
+ "SSE.Views.SortDialog.textAuto": "Auto",
"SSE.Views.SortDialog.textNone": "None",
"SSE.Views.SortDialog.errorNotOriginalCol": "The column you selected is not in the original selected range.",
"SSE.Views.SortDialog.errorNotOriginalRow": "The row you selected is not in the original selected range.",
@@ -2129,6 +2129,8 @@
"SSE.Views.SortDialog.textMoreCols": "(More columns...)",
"SSE.Views.SortDialog.errorSameColumnValue": "%1 is being sorted by values more than once. Delete the duplicate sort criteria and try again.",
"SSE.Views.SortDialog.errorSameColumnColor": "%1 is being sorted by the same color more than once. Delete the duplicate sort criteria and try again.",
+ "SSE.Views.SortDialog.textSortBy": "Sort by",
+ "SSE.Views.SortDialog.textThenBy": "Then by",
"SSE.Views.SortOptionsDialog.textTitle": "Sort Options",
"SSE.Views.SortOptionsDialog.textHeaders": "My data has headers",
"SSE.Views.SortOptionsDialog.textCase": "Case sensitive",