
While sorting the EmpNo column either ASC/DESC, null values should be avoided so that it will be at the end of the grid.
This code just helped to reverse the sorting logic:
if(v1 < v2 || !v1) {
return -1;
}
if(v1 > v2 || !v2) {
return 1;
}
return 0;
Here is a sample code. With this modification, the null values of the 'empNo' column will be sorted at the bottom of the grid when you click on the column header to sort.