Asking DT of what type the column content is

Asking DT of what type the column content is

jd_dot_DataTablesjd_dot_DataTables Posts: 5Questions: 0Answers: 0
edited December 2013 in General
hey :) I want to know if there is a possibility of me asking DT of what type the column content is.
It seems that sorting automatically determines the column type ans sorts accordingly.

I would like to ask DT domething like this:
[code]$('#table').typeOfColumn(5);[/code] or
[code]$('#table').typeOfColumn(5,'numeric')[/code] -> return T or F

And when this would work could I exclude "empty" cells from the test. "empty" stands for empty string, var string = ''; , meaning that I don't hava data for the property that the column is presenting.

Scenarios:
[quote]1
2
"empty"
3

Should be numeric.
[/quote]

[quote]1
2
"empty"
A car
London
4
5

Should be string or text.
[/quote]

Thank you for your time. :)

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Currently no - you could get the information front he private settings object (aoColumns[].sType for this one) but that is generally discouraged as they are considered to be internal variables and might change between versions.

    Allan
This discussion has been closed.