Created
December 24, 2012 04:22
-
-
Save stlsmiths/4367514 to your computer and use it in GitHub Desktop.
Overriding paginatorDSRequest to add extra stuff ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
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