dynamic content in sinfo

dynamic content in sinfo

matthewjmatthewj Posts: 39Questions: 2Answers: 0
edited August 2013 in DataTables 1.9
Hi Allan,

I am trying to put dynamic content in "sInfo" in oLanguage but I am not getting the results:
"sDom": '<"H"><"top"i>tr',
"oLanguage": {
"sInfo": 'Assignments List - You have a Total of _TOTAL_ Active Assignment(s) - ( of _TOTAL_ Completed)'
}

Below is the code to put value in the span:
$('span#completedcnt').html("3");
The above code doesn't seem to work.

When I view the html using firebug I can see that span is included in the header without value: 3
[code]


Assignments List - You have a Total of 9 Active Assignment(s) - ( of 9 Completed)


[/code]

Regards,
Mathew

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    If you want to put dynamic content into the information element, you need to use fnInfoCallback . Otherwise DataTables will just overwrite your changes on each draw.

    Allan
  • matthewjmatthewj Posts: 39Questions: 2Answers: 0
    Thank you very much Allan. This was indeed I was looking for.
This discussion has been closed.