Add Event to Custom Pane (button.searchPanes Case)
Add Event to Custom Pane (button.searchPanes Case)
Hi,
I take the liberty of appealing to you because I am really stuck on a subject related to the following case : https://live.datatables.net/poqarexu/1/edit
As can be seen, on initialisation (delayInit: false) of the customPane there isn't log about its attached events.
And the click event won't work too.
Could you tell me where i'm wrong ?
Thx
This question has an accepted answers - jump to answer
Answers
I believe the creation of the event handlers in the Datatables initialization object was introduced in DT 2.3.0. I upgraded the 2.2.2 version you have in the test case to 2.3.0 in this updated test case:
https://live.datatables.net/poqarexu/2/edit
Also fixed a typo in
delayInit: false,. Now you can see theinitevent output during initialization.I haven't found the docs for this new way of creating the events. The feature might be limited to only Datatables events. Maybe @allan can point us to the docs.
You have
select: { style: 'api' }. I commented this out and nowRogercan be selected. What is your goal for usingselect: { style: 'api' }and creating your own click event?The only reference I found for
delayInitis this thread. Looks like @allan needs to add this to the SearchPanes docs.Kevin
Possibly the solution in this thread will provide the click event you are looking for. I updated the test case to use this delegated event version of the solution presented:
https://live.datatables.net/poqarexu/3/edit
Kevin
Thank you kevin and my apologies, I didn't pay attention to DT's version and typo when i copy/past the code.
Unfortunately I couldn't find the documentation but I understood my mistake and the solution works.
Thanks. Gerald