How to get DataTables to Sort off aData?
How to get DataTables to Sort off aData?
I am building a DataTable definition from an AJAX source, I am leveraging fnReloadAJax and all is working well. However one of my columns renders as an HTML link to a view and edit page. There is a "name" field and a "code" field. The hyperlink goes out to an edit page by passing the code. Here is where I build the column.
[code]
"aoColumns": [
{ "sTitle": "Name",
"sWidth": "225px",
"fnRender": function(oObj) {
return "" + oObj.aData[0] + "";
}
},
[/code]
The problem is, with the default sorting, it is sorting by the text of the href, even though the text of the hyperlink is the name. How can I get the Sorting of the column to use oObj.aData[0] and not the built link text of aData[4]?
Thanks
[code]
"aoColumns": [
{ "sTitle": "Name",
"sWidth": "225px",
"fnRender": function(oObj) {
return "" + oObj.aData[0] + "";
}
},
[/code]
The problem is, with the default sorting, it is sorting by the text of the href, even though the text of the hyperlink is the name. How can I get the Sorting of the column to use oObj.aData[0] and not the built link text of aData[4]?
Thanks
This discussion has been closed.
Replies
[code]
"bUseRendered": false,
[/code]
Is what I was after, I didn't see this property of aocolumns until now. I love this tool more and more :).
Thanks