Any way to query a DT table instance to get all *applicable* events to said table?

Any way to query a DT table instance to get all *applicable* events to said table?

jLinuxjLinux Posts: 981Questions: 73Answers: 75

Im writing a plugin, and a big part of it is making it easier fir users to register callback for DT events,

To do this properly, I need an efficient way of being able to see what events are available. Especially since this may be used on some versions that dont have some of the latest events created.

So, if theres any way to just pull an array of the DT events.. that would be awesome!

I tried poking around in the new $.fn.dataTable.Api( '#example' ) output on some of the examples, and I didnt see anything useful

Thanks!

Answers

  • allanallan Posts: 63,813Questions: 1Answers: 10,517 Site admin

    I don't think there is a way to do this I'm afraid. You could put a hack or a break point into this function which would give you what you are looking for, but there doesn't appear to be a way to use a wildcard event name in jQuery .on('*.dt') for example would be cool - but doesn't work.

    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Oh im not looking to execute an event on every DT event, im just looking to get a list..

    Im writing a plugin that is a wrapper around DT plugins, so I basically need a dynamic way to verify the input specified by the user is a legitimate DT event.

  • allanallan Posts: 63,813Questions: 1Answers: 10,517 Site admin

    Yeah - sorry if it wasn't clear in my reply. I did understand what you were looking for. Basically at the moment you need to add a console.log statement where I indicated above, or a break point there. That is the function that DataTables itself will call when triggering an event. The extensions generally have their own way of doing it.

    Allan

This discussion has been closed.