Date field option values in the Filter submenu were not sorted correctly - they appear in random order.In the drop down submenu dates are not sorted,actually they sorted in alpha but not not depending on the dates when they have occurred.
Following is the code which I have used:-
function getGridData(sCol) {
var nCol = getColumnIndex(sCol), aUniqueValues = [],
sFieldType = window.aoColumns[nCol].sFieldType.toLowerCase(),
sSeparator = sFieldType == "checkbox" || sFieldType == "multiselect" ? "|" : sFieldType == "csv" ? "," : "",
aTrs, aData, sVal, aVals;
if (window.oDataTable.dataTableSettings[0].bFiltered) {
aTrs = oDataTable.$('tr', { "filter": "applied" });
aData = [];
aTrs.each(function () {
aData.push(oDataTable.fnGetData(this));
});
}
else {
aData = window.aaData;
}
for (var i = 0; i < aData.length; i++) {
sVal = aData[i][nCol];
if (sVal && sVal != " ") {
yellow Code:
Original
- yellow Code |
|
|
|
if (sFieldType == "date")
sVal = $.fullCalendar.formatDate(new Date(ticksToDateTime(sVal)), "ddd, MMM d, yyyy");
if (sSeparator) {
aVals = sVal.split(sSeparator);
for (var j = 0; j < aVals.length; j++) {
if (aUniqueValues.indexOf(aVals[j]) == -1)
aUniqueValues.push(aVals[j]);
}
}
else if (aUniqueValues.indexOf(sVal.toLowerCase()) == -1) {//Per team design decision, ALL Rapid Hire screen media text is lower case
aUniqueValues.push(sVal.toLowerCase());
}
}
}
aUniqueValues.sort(basicSort);
return aUniqueValues;
}
I think I need to change sth which I have highlighted in the yellow.So any one know about this issue?.If yes please reply to this post.
Thanks in advance..