Quantcast
Viewing all articles
Browse latest Browse all 8068

Attach a bound Model to a Row in Markup?

Is there a way I can attach the model to the row in markup? If not, can I do it in the controller without having to put the row markup in a separate file?

Ultimately I want to send the model for the row clicked to a controller that will use it.

index.xml

<Alloy>
    <Collection src="brewery" />
    <TableView id="table" dataCollection="brewery">
        <TableViewSection>
            <TableViewRow brewer="{ID_BREWER}">
                    <View backgroundImage="{IMAGE_NAME}"/>
                    <View>
                        <Label id="lBrewer" text="{NAME}"/>
                        <Label id="lBrewerLoc" text="{LOCATION}"/>
                    </View>
            </TableViewRow>
        </TableViewSection>
    </TableView>
</Alloy>
index.js

var breweries = Alloy.Collections.brewery;
breweries.fetch();
Thanks for any advice!

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>