Created
July 26, 2010 21:19
-
-
Save brandonaaron/491266 to your computer and use it in GitHub Desktop.
This file contains 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 model = Object.create(Model); | |
model.create([{...},{...}]); | |
model.update({...}); | |
model.get(id); | |
model.getAll(); | |
model.size(); | |
model.destroy(id); | |
model.destroyAll(); | |
model.find({ foo: 'bar' }); | |
model.find(finderFn(row) {...}); | |
// Paging Plugin | |
model.addPaging(10 /*pageSize (optional)*/); | |
model.getPage(1 /*pageNumber*/); | |
model.getFirstPage(); | |
model.getLastPage(); | |
model.getNextPage(); | |
model.getPrevPage(); | |
model.getNumberOfPages(); | |
model.whichPage(id); | |
model.pageSize = 15; // change page size | |
// Filtering Plugin | |
model.addFiltering({ foo: 'bar' } /*filters (optional)*/); | |
model.addFiltering(filterFn(row) {...} /*filterFn (optional)*/); | |
model.filter(); // removes filters | |
model.filter({ foo: 'bar' } /*filters*/); | |
model.filter(filterFn(row) {...} /*filterFn*/); | |
// Sorting Plugin | |
model.addSorting('foo' /*sortColumn (optional)*/, false /*sortAscending (optional)*/); | |
model.addSorting('foo' /*sortColumn (optional)*/, sortingFn(a, b) {...} /*sortFn (optional)*/, false /*sortAscending (optional)*/); | |
model.sort(); // forces a resort | |
model.sort('foo' /*sortColumn*/, false /*sortAscending*/); | |
model.sort('foo' /*sortColumn*/, sortingFn(a, b) {...} /*sortFn*/, false /*sortAscending*/); | |
// Remote Plugin | |
/* not done... but would hopefully integrate with the other plugins to pull down data as needed and cache */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment