how can i setType for a dynamic columns ?

how can i setType for a dynamic columns ?

fatihafatiha Posts: 7Questions: 4Answers: 0

i'm using datatable, and i'm creating dynamically columns which are containing float data , so for sorting the data i should change the type of the column using this function :
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"formatted-num-pre": function ( a ) {
a = (a==="-") ? 0 : a.replace( /[^\d-.]/g, "" );
return parseFloat( a );
},
"formatted-num-asc": function ( a, b ) {
return a - b;
},
"formatted-num-desc": function ( a, b ) {
return b - a;
}
} );
and set the type like that :( this works for the static column)
"aoColumns": [ { "sType": "formatted-num" }]
how can i do it for columns dynamicaly created?
thanks

Answers

This discussion has been closed.