Failing to add an event handler to the pagination button (only happens once)
Failing to add an event handler to the pagination button (only happens once)
Hi,
Thank you for providing such a marvelous plugin.
My company is starting to use this plugin and we love it.
I'm trying to perform some operations when the user click on the pagination button, but only the "first", "previous", "next", "last" button seems to have my event attached. Buttons 1, 2, 3 don't.
When I do:
[code]
$('.dataTables_paginate').on('click', 'a', function(e) {
console.log(e)
});
[/code]
I get jQuery.Event {originalEvent: MouseEvent, type: "click", isDefaultPrevented: function, timeStamp: 1361813511506, jQuery183043436975846998394: true…}
when I click "first", "previous", "next", "last".
but when I click 1, 2, 3 .. nothing is logged onto the console.
When I try to select the "1" button directly by doing:
[code]
$('a.fg-button:eq(2)').on('click', function() {
console.log('success');
});
[/code]
It displays that once "success" once when I first click on it, then nothing happens.
Can you help me resolve this issue ?
Thank you for taking the time to help me!
Thank you for providing such a marvelous plugin.
My company is starting to use this plugin and we love it.
I'm trying to perform some operations when the user click on the pagination button, but only the "first", "previous", "next", "last" button seems to have my event attached. Buttons 1, 2, 3 don't.
When I do:
[code]
$('.dataTables_paginate').on('click', 'a', function(e) {
console.log(e)
});
[/code]
I get jQuery.Event {originalEvent: MouseEvent, type: "click", isDefaultPrevented: function, timeStamp: 1361813511506, jQuery183043436975846998394: true…}
when I click "first", "previous", "next", "last".
but when I click 1, 2, 3 .. nothing is logged onto the console.
When I try to select the "1" button directly by doing:
[code]
$('a.fg-button:eq(2)').on('click', function() {
console.log('success');
});
[/code]
It displays that once "success" once when I first click on it, then nothing happens.
Can you help me resolve this issue ?
Thank you for taking the time to help me!
This discussion has been closed.
Replies
Allan