Skip to content
Tim Wisniewski edited this page Jan 17, 2016 · 7 revisions
  • initialize should call its BaseProvider's method via BaseProvider.prototype.initialize.apply(this, arguments)
  • To use a custom fields collection, create a class that extends basefields.js and set the fieldsCollection property to it in the provider
  • url should handle URL construction based on the state of the collection (current filters, sorting, etc.)
  • exportUrl should return the downloadable (CSV) version of the url
  • getRecordCount should return a ~~~deferred~~~promise that passes the total number of records that exist when resolved
  • getFields should return a promise that passes a collection (of instance BaseFields) when resolved

getFields should leverage this.fieldsCache, a hash of datasets and fields collections, to share fields collections between provider collections of the same dataset. To access the relevant fields collection, use this.fieldsCache[this.config.dataset].

Beyond that, you can use any other configuration options of Backbone Collections such as parse.

Clone this wiki locally