accessing settings from fnDrawCallback

accessing settings from fnDrawCallback

virgilvirgil Posts: 12Questions: 0Answers: 0
edited November 2011 in General
I need a way to access the table settings from fnDrawCallback in order for example to be able to hide pagination if there is only one page. I am defining oTable in $.ready() but I can't seem to be able to access it using window.oTable inside fnDrawCallback which is strange because it is a global variable and I can access it anywhere. I know I'm wrong somewhere but I don't know where and why. Can anyone help please?
Is there any way of accessing data about the table inside fnDrawCallback?

Thanks,
Virgil

Replies

  • virgilvirgil Posts: 12Questions: 0Answers: 0
    sorry, I can access it using this :)
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Yup - all the DataTables callback functions execute with the scope of the DataTables instance - so fnSettings will always getting you the settings object for the table in question. Also for a number of the callback functions the settings object is passed in, in fnDrawCallback it is the first parameter.

    Allan
This discussion has been closed.