Column sorts on userDate.userID instead of userDate.userName

Column sorts on userDate.userID instead of userDate.userName

justStevejustSteve Posts: 49Questions: 8Answers: 1
edited April 2010 in General
I have a column defined thusly:
[code] {
"sWidth": "20%",
"aaSorting": [[2, "asc"]],
"fnRender": function(obj) {
var userData = obj.aData[obj.iDataColumn];
return ""
+ userData.userName
+ "";
}
},[/code]

It responds to sort / re-sort clicks but sort on the id field instead of name. i'm sure this one's simple

thx

Replies

  • justStevejustSteve Posts: 49Questions: 8Answers: 1
    Has what i've come up with -

    Realizing that the HTML is stripped before being sorted I've inserted a hidden carrying the user name:

    "+userData.userName+" at the beginning of the column.
This discussion has been closed.