Info Language - Custom Info line.. 'X Selected of Y records' - with scroller.

Info Language - Custom Info line.. 'X Selected of Y records' - with scroller.

btBillbtBill Posts: 31Questions: 0Answers: 0
edited July 2013 in General
I would like to a message to be displayed when I select records.

'X of Y records selected totalling $Z.zz'

I'm trying the fnInfoCallback, but it doesnt seem to be firing or showing.

I saw this post ( http://www.datatables.net/forums/discussion/5775/scroller-fninfocallback-problem/p1, but that is only using the main default constants. I need to get the ones selected and some other vals to show.

DT 1.10-dev from git
Scroller 1.1.1.dev from git

Replies

  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    It should be firing on each scroll event. Can you link me to a page showing the problem please?

    Allan
  • btBillbtBill Posts: 31Questions: 0Answers: 0
    I;ve gotten it to work when scrolling, but that is not good enough. I need to have that info section updated when I click on checkboxes for the different rows. i have a click event highlighting the row when i check a chockbox. I was hoping that I would be able to total up the number of selected (as well SUM another row of values) and then show that total in the footer as well.

    Is there a way to manually fire the InfoCallback or something similar.

    I am currently trying to just use jQuery and update the DOM. This is working up to a point....

    I can get the initial Total of rows, but when the filtering happens, it doesnt show the right full total anymore.

    Using something that hooks directly into the rows that are showing would be helpful.

    Thanks.
  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    I see - currently there isn't a method to fire the info callback yourself. What you might consider doing is using a technique something like this: http://datatables.net/release-datatables/examples/advanced_init/dom_toolbar.html to show a bit of custom text. An alternative is to write a little plug-in API method that will allow the info callback to be called programmatically.

    Allan
  • btBillbtBill Posts: 31Questions: 0Answers: 0
    I was hoping that since the footer is updated on filtering, I would be able to hook into that. I will see if I can get in contact with the author of the plugin.

    (i'm kind of bluring the two threads I have now: http://www.datatables.net/forums/discussion/comment/49856 )

    Hopefully I can find a method to be able to trigger an event when filtering.
This discussion has been closed.