Skip to content

Instantly share code, notes, and snippets.

@PilotBob
Created February 18, 2015 21:34
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 PilotBob/fbfb0157c01218a60292 to your computer and use it in GitHub Desktop.
Save PilotBob/fbfb0157c01218a60292 to your computer and use it in GitHub Desktop.
var GetGridState = function(dataSource, grid$) {
var state = {
page: dataSource.page(),
pageSize: dataSource.pageSize(),
sort: dataSource.sort(),
group: dataSource.group(),
filter: dataSource.filter(),
scroll: $(".k-grid-content", grid$).scrollTop(),
aggregate: dataSource.aggregate()
};
if (state.pageSize === undefined) {
delete state.page;
delete state.pageSize;
}
return state;
}
Is there a better way to just not create the pagePagesize properties orignally without checking later?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment