Change table_info depending on table.page() & table.page.len()
Change table_info depending on table.page() & table.page.len()

Hi
I am trying to change the text below the data table which is normally something like:
"Showing 1 to 10 of 57 entries"
To manually adjust the text I want to do something like:
'language': {
'info': 'Showing ' + ((table.page()-1)*table.page.len()+1) + ' to ' + (table.page()*table.page.len()) + ' of ' + table.totalRecords + ' entries'\n
}
Since the table itself is just about to be defined I cannot access the page field, and I do not know how I can access the information otherwise.
Do any of you know how to solve this?
This question has an accepted answers - jump to answer
Answers
See here, you can use macros.
Colin
How can I use them in computations? The macros apparently substitute substrings with the according value, but I don't see how I can use them.
Ah, I see. You would do that in the
draw
, and just over-write the existing string in the element - something like this.Colin
With the approach of overwriting 'div.dataTables_info', we overwrite the datatables_info of every table on the same page. How can I change the info of a specific table?
Nevermind, got it.