Class View

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(options?: ViewOptions): View

Parameters

Returns

View

Properties

public $el: JQuery

public attributes: any

public cid: string

public className: string

public collection: Collection

public el: any

public id: string

public model: TModel in Backbone.View<TModel extends Model>

public tagName: string

Methods

public $(selector: string): JQuery

Parameters

  • selector: string

Returns

JQuery

public $(selector: any): JQuery

Parameters

  • selector: any

Returns

JQuery

public _ensureElement()

public bind(eventName: string, callback: Function, context?: any): any

Parameters

  • eventName: string
  • callback: Function
  • context?: any optional

Returns

any

public bind(eventName: string, callback: Function, context?: any): any

Parameters

  • eventName: string
  • callback: Function
  • context?: any optional

Returns

any

public delegateEvents(events?: any): any

Parameters

  • events?: any optional

Returns

any

public events(): any

Events hash or a method returning the events hash that maps events/selectors to methods on your View. For assigning events as object hash, do it like this: this.events = { "event:selector": callback, ... }; That works only if you set it in the constructor or the initialize method.

Returns

any

private static extend(properties: any, classProperties?: any): any

Do not use, prefer TypeScript's extend functionality.

Parameters

  • properties: any
  • classProperties?: any optional

Returns

any

public listenTo(object: any, events: string, callback: Function): any

Parameters

  • object: any
  • events: string
  • callback: Function

Returns

any

public listenTo(object: any, events: string, callback: Function): any

Parameters

  • object: any
  • events: string
  • callback: Function

Returns

any

public listenToOnce(object: any, events: string, callback: Function): any

Parameters

  • object: any
  • events: string
  • callback: Function

Returns

any

public listenToOnce(object: any, events: string, callback: Function): any

Parameters

  • object: any
  • events: string
  • callback: Function

Returns

any

public make(tagName: string, attrs?: any, opts?: any): View

Parameters

  • tagName: string
  • attrs?: any optional
  • opts?: any optional

Returns

View

public make(tagName: any, attributes?: any, content?: any): any

Parameters

  • tagName: any
  • attributes?: any optional
  • content?: any optional

Returns

any

public off(eventName?: string, callback?: Function, context?: any): any

Parameters

  • eventName?: string optional
  • callback?: Function optional
  • context?: any optional

Returns

any

public off(eventName?: string, callback?: Function, context?: any): any

Parameters

  • eventName?: string optional
  • callback?: Function optional
  • context?: any optional

Returns

any

public on(eventName: string, callback?: Function, context?: any): any

Parameters

  • eventName: string
  • callback?: Function optional
  • context?: any optional

Returns

any

public on(eventName: string, callback?: Function, context?: any): any

Parameters

  • eventName: string
  • callback?: Function optional
  • context?: any optional

Returns

any

public once(events: string, callback: Function, context?: any): any

Parameters

  • events: string
  • callback: Function
  • context?: any optional

Returns

any

public once(events: string, callback: Function, context?: any): any

Parameters

  • events: string
  • callback: Function
  • context?: any optional

Returns

any

public remove(): View

Returns

View

public render(): View

Returns

View

public setElement(element: HTMLElement, delegate?: boolean): View

Parameters

  • element: HTMLElement
  • delegate?: boolean optional

Returns

View

public setElement(element: JQuery, delegate?: boolean): View

Parameters

  • element: JQuery
  • delegate?: boolean optional

Returns

View

public setElement(element: any): View

Parameters

  • element: any

Returns

View

public stopListening(object?: any, events?: string, callback?: Function): any

Parameters

  • object?: any optional
  • events?: string optional
  • callback?: Function optional

Returns

any

public stopListening(object?: any, events?: string, callback?: Function): any

Parameters

  • object?: any optional
  • events?: string optional
  • callback?: Function optional

Returns

any

public trigger(eventName: string, args?: Array<any>): any

Parameters

  • eventName: string
  • args?: Array<any> optional

Returns

any

public trigger(eventName: string, args?: Array<any>): any

Parameters

  • eventName: string
  • args?: Array<any> optional

Returns

any

public unbind(eventName?: string, callback?: Function, context?: any): any

Parameters

  • eventName?: string optional
  • callback?: Function optional
  • context?: any optional

Returns

any

public unbind(eventName?: string, callback?: Function, context?: any): any

Parameters

  • eventName?: string optional
  • callback?: Function optional
  • context?: any optional

Returns

any

public undelegateEvents(): any

Returns

any