jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Sorting
Tagged: grid, jquery grid, jqwidgets grid, jqxgrid
This topic contains 1 reply, has 2 voices, and was last updated by Peter Stoev 9 years, 5 months ago.
-
AuthorSorting Posts
-
I have columns like this since cell renders has html when i do sorting it is sorting on ‘c’,’i’,’s’ but i want to be sort on tempValue which is numeric value
{
text: ‘CAD’, datafield: ‘StCAD’, width: ‘4%’, filtertype: ‘checkedlist’, cellsalign: ‘center’, align: ‘center’, filteritems: [‘Complete’, ‘Incomplete’, ‘Skipped’], columntype: ‘textbox’,
cellsrenderer: function (row, cell, value) {
var tempValue = this.owner.source.records[row][‘CAD’];
if (tempValue === null) {
tempValue = ”;
}
if (value === “I” && tempValue!=”) {
return ‘<div style=”background:#FFD1D1 ; overflow: hidden; text-overflow: ellipsis; padding-bottom: 2px; text-align: center; margin-right: 2px; margin-left: 4px; margin-top: 5%;”>’ + tempValue + ‘</div>’
} else if (value === “S” && tempValue != ”) {
return ‘<div style=”background:#84D5EC ; overflow: hidden; text-overflow: ellipsis; padding-bottom: 2px; text-align: center; margin-right: 2px; margin-left: 4px; margin-top: 5%;”>’ + tempValue + ‘</div>’
} else if (value === “C” && tempValue != ”) {
return ‘<div style=”background:#A9D10E ; overflow: hidden; text-overflow: ellipsis; padding-bottom: 2px; text-align: center; margin-right: 2px; margin-left: 4px; margin-top: 5%;”>’ + tempValue + ‘</div>’
} else {
return ‘<div style=”text-align: center;margin-top: 5%;”>’ + tempValue + ‘</div>’
}
},
createfilterwidget: function (column, columnElement, widget) {
widget.jqxDropDownList({
source: [‘C’, ‘I’, ‘S’], renderer: function (index, label, value) {
switch (label) {
case ‘(Select All)’:
return ‘(Select All)’;
break;
case ‘C’:
return ‘Complete’;
break;
case ‘I’:
return ‘Incomplete’;
break;
case ‘S’:
return ‘Skipped’;
break;
}
}
});
}
}Hi Venki7092,
In your case, you will need to implement sorting function. Please, refer to: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/customsorting.htm?arctic in order to learn how to implement that Grid sorting.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.