Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Creating TableView Widget - Continues to reference row.xml in app/views instead of widget/views

$
0
0

Hi all,

I'm trying to create a TableView Widget that i'm going to use on multiple screens in my app. I'm looking for how to set the row.xml file to use for building the data for the table. I'm using JSON data to populate the table based on the row.xml file.

However, I can't seem to figure out how to set my TableView widget to reference its own row file, or any other row file of my choice. Instead, it continues to reference the row.xml in my default file.

Here is where I'm setting up the table data:

widget.js

data.push(Alloy.createController('row2', {  
            firstRow : tempString,
            currentStatus: dataToAdd[i].currentStatus,
            statusMessage: dataToAdd[i].statusMessage,
            color: dataToAdd[i].overallHealth
 
        }).getView());  
    }  
 
    $.table.setData(data);

I have included my widget on the page and that works fine. The problem is even though my TableView is in my widget.xml, it is reference the row.xml inside my app/views instead of widget/views.

widget.xml

<Alloy>
    <TableView separatorColor='#CCC' id="table" >
    </TableView>
</Alloy>
row2.xml
<Alloy>  
    <TableViewRow borderWidth="1dp" borderColor="#CCC" hasChild="true" layout="vertical" onClick="onRowClick">  
                <Label  id="firstRow" left="0"/>
                <Label  left="20dp" color="#000" id="currentStatus" />
    </TableViewRow>  
</Alloy>

I hope this makes sense, let me know if you need any other code or explanation.

Thanks for the help.


Viewing all articles
Browse latest Browse all 8068

Trending Articles