Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

Add item view attributes for collection view items #384

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

liorcode
Copy link
Contributor

I added a way to pass attributes to the constructor of the item view.

This is how it is used Inside a collection view:

Thorax.CollectionView.extend({
    name: "app/list",
    initialize: function() {
        this.itemAttributes = {
            myVar : 'value'
        }
});

Then inside a collection item, myVar is availble:

Thorax.View.extend({
    name: "app/list-item",    
    initialize: function() {
        var a = this.myVar;
    }
});

@CLAassistant
Copy link

CLAassistant commented Jul 12, 2019

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants