Skip to content

Commit

Permalink
Don't provide sort icons for composite agg columns
Browse files Browse the repository at this point in the history
Only composite source columns can be sorted on, not the calculated
columns.
  • Loading branch information
johnvanbreda committed May 14, 2020
1 parent 1976615 commit 82ed36d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/indicia.datacomponents/jquery.idc.dataGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
function addColumnHeadings(el, header) {
var headerRow = $('<tr/>').appendTo(header);
var breakpointsByIdx = [];
var aggInfo = el.settings.sourceObject.settings.aggregation;
var srcSettings = el.settings.sourceObject.settings;
var aggInfo = srcSettings.aggregation;
if (el.settings.autoResponsiveCols) {
// Build list of breakpoints to use by column position.
$.each(el.settings.responsiveOptions.breakpoints, function eachPoint(name, point) {
Expand Down Expand Up @@ -145,9 +146,9 @@
sortableField = sortableField
|| indiciaData.fieldConvertorSortFields[this.field.simpleFieldName()]
// Simple top level terms agg columns should sort OK.
|| (aggInfo && aggInfo[this.field])
|| (srcSettings.mode !== 'compositeAggregation' && aggInfo && aggInfo[this.field])
// Doc_count treated like a special agg - supports sort.
|| (aggInfo && this.field === 'doc_count');
|| (srcSettings.mode !== 'compositeAggregation' && aggInfo && this.field === 'doc_count');
if (el.settings.sortable !== false && sortableField) {
heading += '<span class="sort fas fa-sort"></span>';
}
Expand Down

0 comments on commit 82ed36d

Please sign in to comment.