Sorting with HTML and fnrender

Sorting with HTML and fnrender

RockbRockb Posts: 97Questions: 0Answers: 0
edited April 2014 in General
Hello, first of all I'm deeply sorry, cause I think the solution is still there, but I couldn't figure it out. I've tried the plugin-ins, the answers in this forums, even some samples on github crashed my table :-D My request: I want to sort html-columns with the fnrender-function... not as a string, but with nummeric.

My "problem" looks pretty simple: Most of my columns have html-code, which were rendered before, e.g.

[code] "aoColumnDefs": [ { "fnRender": function ( oObj ) { return '' + oObj.aData[2] +''; }, "sType": "html", "bVisible": false, "asSorting": [ "desc" ], "aTargets": [ 2 ] } ][/code]

...basically it's wraps the value with a link from a different column. For some reasons it's not possible combining them before.

With strings, it's no problem, but not with numerics. It sorts - even with numbers - as a string. So datatables sorts it like

[code]9988
99
979[/code]

...for sure, it has to be:

[code]9988
979
99[/code]

Hopefully there is somebody who could help me. I've already tried http://datatables.net/plug-ins/sorting#numbers_html and http://datatables.net/plug-ins/type-detection#numbers_html but it doesn't work. Maybe I made something wrong.

Sebastian

Replies

  • RockbRockb Posts: 97Questions: 0Answers: 0
    Allright, with

    [code]"bUseRendered": false[/code]

    I could handle everything.
This discussion has been closed.