mRender interfer with sorting of columns???
mRender interfer with sorting of columns???
comfuner
Posts: 9Questions: 0Answers: 0
I've applied mRender on columns to turns numbers into images (1 -> 1 star, 2 -> 2 stars, etc...)
now I can't sort the "changed" columns, why?
this is the code:
[code]
...
"aoColumnDefs": [
{
"mRender": function (data, type, row) {
img_str = '';
return img_str;
}, "aTargets": [9, 8, 7, 6, 5, 4, 3, 2]
},
{ "sClass": "center", "aTargets": [9, 8, 7, 6, 5, 4, 3, 2] }
],
...
[/code]
now I can't sort the "changed" columns, why?
this is the code:
[code]
...
"aoColumnDefs": [
{
"mRender": function (data, type, row) {
img_str = '';
return img_str;
}, "aTargets": [9, 8, 7, 6, 5, 4, 3, 2]
},
{ "sClass": "center", "aTargets": [9, 8, 7, 6, 5, 4, 3, 2] }
],
...
[/code]
This discussion has been closed.
Replies
http://www.haaretz.co.il/st/inter/tests/Elijahu/critic/1/index1.html
[code]
"aoColumnDefs": [
{
"mRender": function (data, type, row) {
// checking if type is display - otherwise you change things you dont need
if(type == 'display'){
data = '';
}
return data;
}, "aTargets": [9, 8, 7, 6, 5, 4, 3, 2]
},
{ "sClass": "center", "aTargets": [9, 8, 7, 6, 5, 4, 3, 2] }
],
[/code]
Let me know if that helped.
Allan