0

What I am attempting to do is when the user clicks on the View All Content Pages it goes OUT of pagination view so I want it to remove the pagination links which it removes the pages but not the First Preview Next Last links, however when a user clicks on View Paginated Records then it adds the First Preview Next Last links.

http://jsfiddle.net/xtremer360/hrfYA/7/

1
  • 1
    So you want to hide the 'First Preview Next Last' buttons when pagination is disabled? Commented Jul 24, 2011 at 17:35

1 Answer 1

2

If you want to show/hide the pagination controls according to what you are doing you just need to show/hide them:

$('.viewAll').live('click', function(e) {
    e.preventDefault();
    oTable.fnLengthChange(-1);
    $(this).removeClass('viewAll').addClass('paginateRecords');
    $(this).find('strong').html('View Paginated Records');
    $('.pagination').hide();
});

$('.paginateRecords').live('click', function(e) {
    e.preventDefault();
    oTable.fnLengthChange(10);
    $(this).removeClass('paginateRecords').addClass('viewAll');
    $(this).find('strong').html('View All Content Pages');    
    $('.pagination').show();    
});

fiddle: http://jsfiddle.net/nicolapeluchetti/hrfYA/9/

Sign up to request clarification or add additional context in comments.

2 Comments

I've said it was and I'll said it again you are amazing.
There's only one last thing I have to do with my script that deals with the dataTables plugin and that's css related. Lets say you're on page 1 of 3. In that case the First and Last buttons should be disabled. I have a special style that gets applied to disabled buttons but they get canceled out because there's other styles applied to them and it doesn't show the disabled button style.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.