Type Parameters

Hierarchy (View Summary)

Implements

Constructors

Properties

comparator:
    | string
    | (element: TModel) => string | number
    | (compare: TModel, to?: TModel) => number

Specify a model attribute name (string) or function that will be used to sort the collection.

length: number
model: new (...args: any[]) => TModel
models: TModel[]
url: string | () => string

Sets the url property (or function) on a collection to reference its location on the server.

Collection

Methods

  • Parameters

    • index: number

    Returns TModel

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Returns any

  • Returns this

  • Parameters

    Returns boolean

  • Parameters

    • Optionaln: number

    Returns TModel[]

  • Parameters

    • properties: any

    Returns TModel

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • value: TModel
    • OptionalisSorted: boolean

    Returns number

  • Parameters

    Returns void

  • Parameters

    • methodName: string
    • ...args: any[]

    Returns any

  • Returns boolean

  • Parameters

    • value: TModel
    • Optionalfrom: number

    Returns number

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • attrs: any

    Returns any

  • Parameters

    • OptionaleventName: string
    • Optionalcallback: EventHandler
    • Optionalcontext: any

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    Returns this

  • Parameters

    • response: any
    • Optionaloptions: any

    Returns any

  • Parameters

    • attribute: string

    Returns any[]

  • For use with collections as ES classes. If you define a preinitialize method, it will be invoked when the Collection is first created and before any instantiation logic is run for the Collection.

    Parameters

    Returns void

  • Parameters

    • Optionaln: number

    Returns TModel[]

  • The set method performs a "smart" update of the collection with the passed list of models. If a model in the list isn't yet in the collection it will be added; if the model is already in the collection its attributes will be merged; and if the collection contains any models that aren't present in the list, they'll be removed. All of the appropriate "add", "remove", and "change" events are fired as this happens. Returns the touched models in the collection. If you'd like to customize the behavior, you can disable it with options: {add: false}, {remove: false}, or {merge: false}.

    Parameters

    Returns TModel[]

  • Returns number

  • Return a shallow copy of this collection's models, using the same options as native Array#slice.

    Parameters

    • Optionalmin: number
    • Optionalmax: number

    Returns TModel[]

  • Parameters

    • Optionalobject: any
    • Optionalevents: string
    • Optionalcallback: EventHandler

    Returns this

  • Parameters

    • ...arg: any[]

    Returns JQueryXHR

  • Parameters

    • Optionaln: number

    Returns TModel[]

  • Parameters

    • Optionaloptions: any

    Returns any

  • Parameters

    • eventName: string
    • ...args: any[]

    Returns this

  • Parameters

    • OptionaleventName: string
    • Optionalcallback: EventHandler
    • Optionalcontext: any

    Returns this

  • Parameters

    • properties: any

    Returns TModel[]

  • Do not use, prefer TypeScript's extend functionality.

    Parameters

    • properties: any
    • OptionalclassProperties: any

    Returns any