problem with pagination
problem with pagination
Hi everybody,
I encountered a problem that i can't solve with the pagination :
I use the "sPaginationType": "full_numbers" so i get for 30 records 10 per page a pgination like :
First Previous 1 2 3 Next Last
I would like to put an alert when one of these buttons is clicked :
[code]
$('#the_table_paginate').bind("click", function () {
alert ('pagination');
});
[/code]
This works fine for First, Previous, Next, Last but not for 1, 2, 3 buttons.
I also tried $('.paginate_button'), $('span') with no success.
If someone has got an idea, please do not hesitate.
Thanks (and by the way, this tool is fantastic)
I encountered a problem that i can't solve with the pagination :
I use the "sPaginationType": "full_numbers" so i get for 30 records 10 per page a pgination like :
First Previous 1 2 3 Next Last
I would like to put an alert when one of these buttons is clicked :
[code]
$('#the_table_paginate').bind("click", function () {
alert ('pagination');
});
[/code]
This works fine for First, Previous, Next, Last but not for 1, 2, 3 buttons.
I also tried $('.paginate_button'), $('span') with no success.
If someone has got an idea, please do not hesitate.
Thanks (and by the way, this tool is fantastic)
This discussion has been closed.
Replies
[code]
$('#the_table_paginate').live("click", function () {
alert ('pagination');
});
[/code]
Notice the 'live' instead of 'bind'. The number buttons are created dynamically and the bind is getting lost in the shuffle.
When I had it working on my end, I had modified the source code by removing all the "return false" code, so that click events would bubble up to other events. The other possibility is my jquery selector, but I'm leaning towards the event propagation since the first, previous, next, and last "links" work, but not the number "links".
I don't want to go inside the source code because I'm not enough skilly for that.
I'm still trying to find another way to bypass the problem
Hopefully Allan might chime in and let us know what is happening and/or why the event propagation is stopped for the pagination number buttons.
I've updated Visual Event ( http://sprymedia.co.uk/article/Visual+Event ) to work with jQuery 1.4, to help with this, and while it has a bit (i.e. it looks like it should be working!) I still can't see it... A bit more work needed on this one. It's odd.
Allan
Thanks for looking at this one. I couldn't figure out why removing the 'return false' didn't do it. So I also removed '.bind( 'mousedown', fnFalse ).bind( 'selectstart', fnFalse );' Line 528 in 1.6.2. Although I wasn't sure what implications this had, but maybe you can shed some light on why these are there as well. Thanks again.