diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 26f808325..2029cc75d 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -188,6 +188,15 @@ const Component = Backbone.Model.extend(Styleable).extend( return !!(this.get('type') == type); }, + /** + * Get the index of the component in the parent collection. + * @return {Number} + */ + index() { + const { collection } = this; + return collection && collection.indexOf(this); + }, + /** * Find inner components by query string. * **ATTENTION**: this method works only with already rendered component