- Added documentation to Marionette.CompositeView.

- Added event callback definitions.
- Updated for Marionette 2.3.0.
This commit is contained in:
Peter Palotas
2014-12-28 21:05:30 +01:00
parent 6df70bcd91
commit b9f410e024
+45 -6
View File
@@ -982,16 +982,55 @@ declare module Marionette {
onRemoveChild(childView: any): void;
}
/**
* A CompositeView extends from CollectionView to be used as a composite view
* for scenarios where it should represent both a branch and leaf in a tree
* structure, or for scenarios where a collection needs to be rendered within
* a wrapper template.
*/
class CompositeView<TModel extends Backbone.Model> extends CollectionView<TModel> {
constructor(options?: any);
constructor(options?: CollectionViewOptions<TModel>);
itemView: any;
itemViewContainer: string;
/**
* Each childView will be rendered using the childView's template. The
* CompositeView's template is rendered and the childView's templates are
* added to this.
*/
childView: any;
render(): CompositeView<TModel>;
appendHtml(cv: any, iv: any);
renderModel(): any;
/**
* By default the composite view uses the same attachHtml method that the
* collection view provides. This means the view will call jQuery's
* .append to move the HTML contents from the child view instance in to
* the collection view's el.
* This is typically not very useful as a composite view will usually render
* a container DOM element in which the child views should be placed.
* This can be either a string or a function returning a string.
*/
childViewContainer: any;
render(): CompositeView<TModel>;
/**
* Invoked before the model has been rendered
*/
onBeforeRenderTemplate(): void;
/**
* Invoked after the model has been rendered.
*/
onRenderTemplate(): void;
/**
* Invoked before the collection of models is rendered
*/
onBeforeRenderCollection(): void;
/**
* Invoked after the collection of models has been rendered
*/
onRenderCollection(): void;
}
class LayoutView<TModel extends Backbone.Model> extends ItemView<TModel> {