Help to create events with full number paging

Help to create events with full number paging

exzeroexzero Posts: 1Questions: 0Answers: 0
edited February 2011 in General
Hi. I'm trying to add an event with full number paging. It worked with next, last, first and last but not with the numbers.

[code]
$(".ui-button").bind('click', function() {
alert('test');
});
[/code]

Thanks for the help.

Replies

  • emeraldemerald Posts: 5Questions: 0Answers: 0
    Hi,
    I have the same problem, if I click on the (first, previous, next, last) buttons the alert message is shown, but if I click on a numbered button, nothing happens. Have you managaed to solve this problem?

    [code]
    $('.paging_full_numbers').live('click', function () {
    alert('click');
    });
    [/code]
  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Try adding in a span to the selector, since the buttons are actually span tags:

    [code]
    $('.paging_full_numbers span').live('click', function () {
    alert('click');
    });
    [/code]
    Allan
  • emeraldemerald Posts: 5Questions: 0Answers: 0
    edited May 2011
    Hi allan,
    thanks for your suggestion, but I have solved it (my problem) with a differnet approach, I simply added a function call in the dataTables code itself
    [code]
    U=function(){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;m(g);PageChanged(this.innerHTML*1-1);return false}
    [/code]
    in my other js file I have the function:
    [code]
    function PageChanged(target) {
    alert('new Target' + target);
    }
    [/code]

    Since you took the time to post a solution, I tested it, no success. Is it possible that two 'click' events are the problem? if I use:
    [code]
    $('.paging_full_numbers').unbind('click').bind('click', function () {
    alert('click');
    });
    [/code]
    I get the alert message, but of course the page will not be chnaged :)
This discussion has been closed.