Skip to content

Commit

Permalink
F#1489 Fix sorting error if the data grid contains blanks (#1560)
Browse files Browse the repository at this point in the history
* #1489 Fix grid override css

* #1489 Fix grid sorting error

* #1489 Fix grid sorting error
  • Loading branch information
ninezero90hy authored and alchan-lee committed Mar 5, 2019
1 parent dd88a86 commit 400d1fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Expand Up @@ -1068,6 +1068,15 @@ export class GridComponent implements AfterViewInit, OnDestroy {
for (let index: number = 0; index < cols.length; index += 1) {
const field = cols[index].sortCol.field;
const sign = cols[index].sortAsc ? 1 : -1;

if (_.isNil(row1[field]) || row1[field] === '') {
row1[field] = " ";
}

if (_.isNil(row2[field]) || row2[field] === '') {
row2[field] = " ";
}

const value1 = row1[field];
const value2 = row2[field];
const result = (value1 === value2 ? 0 : (value1 > value2 ? 1 : -1)) * sign;
Expand Down
6 changes: 1 addition & 5 deletions discovery-frontend/src/assets/grid/slick.grid.override.css
Expand Up @@ -77,7 +77,6 @@

:host /deep/ .slick-sort-indicator {
float: inherit;
margin: 0;
width: 7px;
height: 4px;
display: inline-block;
Expand All @@ -93,18 +92,15 @@

:host /deep/ .slick-sort-indicator-asc {
position: absolute;
top: 10px;
right: 9px;
width: 7px;
height: 4px;
}

:host /deep/ .slick-sort-indicator-desc {
position: absolute;
top: 15px;
right: 9px;
width: 7px;
height: 4px;
margin-top:0;
background-position: left -5px;
}

Expand Down

0 comments on commit 400d1fd

Please sign in to comment.