Marky
Marky

Reputation: 55

How to get the data-column-index in DataTables?

I already tried, data('columnIndex') but it gives me undefine.

I need to get the value of data-column-index for my custom reOrder function.

$('#columnAge').data('column-index') // undefined
$('#columnAge').data('columnIndex') // get the value of data-index instead

Thanks

Upvotes: 0

Views: 1005

Answers (1)

Moeez Saiyam
Moeez Saiyam

Reputation: 107

Try next code:

$(#columnAge).attr("data-column-index")

I hope that work. It worked fine for my case.

Upvotes: 1

Related Questions