Change color of a label that is in a tableViewRow
Hi there!
I want to change the color of my label, which is on a tableViewRow, while touched.
I have a tableView called 'listView'. This one i fill up with a array of rows called 'tabledata'. These Rows contain three labels, named each 'rowGroup', 'rowTitle' and 'rowDetail'.
var row = crTableRow({
//some stuff not important ;)
});
var rowGroup = crLabel({
color: '#333'
text: foo
});
var rowTitle = crLabel({
color: '#333'
text: foo
});
var rowDetail = crLabel({
color: '#333'
text: foo
});
row.add(rowGroup);
row.add(rowTitle);
row.add(rowDetail);
tabledata[z] = row;
z++;
listView.data = tabledata;
My eventListeners are looking like this:
listView.addEventListener('touchstart',function(e){
e.row.rowGroup.color('#FFF'));
e.row.rowTitle.color('#FFF');
e.row.rowDetail.color('#FFF');
});
listView.addEventListener('touchend',function(e){
e.row.rowGroup.color('#333');
e.row.rowTitle.color('#333');
e.row.rowDetail.color('#333');
});
I know that something in my event listeners is wrong, but what?
This is my Error, which appears in the Log:
"Result of expression 'e.row.rowGroup' [undefined] is not an object.";
1 Answer
-
Accepted Answer
e.row.children[0].color = '#f00';