Skip to content

Set an option without triggering the paged event #20

Merged
merged 1 commit into from Jul 26, 2013

2 participants

@m-hume
m-hume commented May 25, 2013

Usage:
.jqPagination('option', {key: value[, key: value][, trigger: true|false ]})

Legacy operation is maintained but now you can set multiple properties with one call and specify if you want the paged trigger to fire

the following sets the max pages to 10 and the current page to 5 whilst not triggering paged
.jqPagination('option', {
max_page: 10,
current_page: 5,
trigger: false
});

@m-hume m-hume Set an option without triggering the paged event
Usage:
.jqPagination('option', {key: value[, key: value][, trigger: true|false ]})

Legacy operation is maintained but now you can set multiple properties with one call and specify if you want the paged trigger to fire

the following sets the max pages to 10 and the current page to 5 whilst not triggering paged 
.jqPagination('option', {
    max_page: 10,
    current_page: 5,
    trigger: false
});
ad2991d
@m-hume m-hume commented on the diff May 25, 2013
js/jquery.jqpagination.js
+ // if max_page property is set call setMaxPage
+ if(options.max_page !== undefined){
+ result = base.setMaxPage(options.max_page, prevent_paged);
+ }
+
+ // if set_page property is set call setPage
+ if(options.set_page !== undefined){
+ result = base.setPage(options.set_page, prevent_paged);
+ }
@m-hume
m-hume added a note May 25, 2013

set_page should actually read current_page
oops

lines 331 and 332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@beneverard beneverard merged commit ad2991d into beneverard:master Jul 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.