jquery - Tablesorter - can pager be automatically disabled when sorting? -


We are using thickly programmed tables for a good time and now the user has asked us to pager Can be disabled automatically when any column helps the user

If you click on the following link, you will see a demo table. Press "Disable Pager" to see all 50 rows. Then sort according to the "Major" column, you will see that it automatically returns back into the pageview with 10 rows

Now I know that the third button was destroyed to get the pager around it But I like to stop pager from pager by default after sorting. Is it possible ?? The reason for this is that we use only one button that turns pager on / off in our application.

The pager was not set up on the disabled page, but with a slight code, Can zoom in for the requirements ()

I have added this button inside the pager container

   

and used this code:

  var $ table = $ ('table'), $ pager = $ ('. Pager'), PagerDisabled = false, saved page size = 10, disabled page size = 9999; $ Tables Tables ({theme: 'blue', widget: ['zebra', 'column']}) .tablesorterPager ({container: $ pager}); $ Pager.find ('. Toggle'). ('Click', function () {pagerDisabled =! PagerDisabled; var pager = $ table [0] .config.pager; if (pager.size! == disablePageSize) {// Save User Set Page Size Saved PageSize = Pager.size;} If (pager disable disabled) {// set pagerLastSize before enabling pager $ table.data ('pagerLastSize', savedPageSize);} // toggle pager status $ table.trigger (('disabled' : 'Enabled') + '.pager') // change button text $ (this) .html (pager disabled? 'Enable': 'disabled'); if (pager disabled) {// set pagerst size $ Table.data ('pagerLastSiz after disabling pager E ', disabledPageSize);}});  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -