Skip to content

Instantly share code, notes, and snippets.

@stlsmiths
Created December 24, 2012 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stlsmiths/4367514 to your computer and use it in GitHub Desktop.
Save stlsmiths/4367514 to your computer and use it in GitHub Desktop.
Overriding paginatorDSRequest to add extra stuff ...
//
var dt = new Y.DataTable({
columns: ...
paginator: .....
requestStringTemplate: "?page={page}&itemsPerPage={itemsPerPage}&sortBy={sortBy}" // or whatever
});
dt.plug( Y.Plugin.DataTableDataSource, {
datasource: ds
});
dt.render('#tableBar');
// override the paginatorDSRequest method and add your stuff to the request string
dt.paginatorDSRequest = function(requestString) {
this.datasource.load({
request: requestString + '&addOne=' + addOne + '&addTwo' + addTwo
});
}
// the "processPageRequest" method uses the overridden dt.paginatorDSRequest method above for
// each and every page request ...
dt.processPageRequest(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment