Closed GirishaVil closed 6 years ago
Hello, you know the limit when you setup the component :
$('#myTable').paginate({
limit: 10 // 10 elements per page
})
But you can't get it once it's initialized. You have to modify the code. For instance, you could change the build method to return the Paginator object instead of the container (line 23) :
...
build: function(obj, opts) {
this.obj = obj;
this.options = opts;
if(!this.options.optional || this._totalRows() > this.options.limit) {
this._createNavigation();
this._setPage();
}
if(this.options.onCreate) this.options.onCreate(obj);
return this; // instead of return this.obj;
},
...
This way you can access the options used to setup your pagination :
var myPaginator = $('#myTable').paginate({
limit: 10 // 10 elements per page
})
...
alert(myPaginator.options.limit);
Hello @GirishaVil!
As noted by @Dolu-, you may either:
options
property after initializing the paginator.If you think there should be a data
or property accessor for this kind of options, feel free to comment and reopen this issue.
Best regards, Daniel
how to get number of records per page limit?