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

create tableview row in a separate js

$
0
0

I want to create a TableViewRow in a separate js called disponibleRow.js, but it doesn't work. I can't find the error. This is the error:

"undefined is not an object (evaluating 't.disponibleRow.add')";

listadoCuponesVC.js

var disponibleRow = Alloy.createController('Rows/disponibleRow', cuponAux).getView();
Ti.API.debug("row: " + disponibleRow);
 
disponibleRow.addEventListener('click', function(e){
    Ti.API.debug('row clicked: ' + e.rowData.value);
    Alloy.createController('codigoVC', cuponAux).getView();
});
 
disponibles.push(disponibleRow);
disponibleRow.js
var fecha =  Titanium.UI.createLabel({
    text: args.get('date'),
    font:{fontSize:12,fontWeight:'light'},
    width:'auto',
    textAlign:'left',
    color: '#72828c',
    bottom:2,
    left:45,
    height:12
});
 
var puntos =  Titanium.UI.createImageView({
    image:"/images/puntos_azules.png",
    width:16,
    height:16,
    right:10
});
 
$.disponibleRow.add(fecha);
$.disponibleRow.add(puntos);
disponibleRow.xml
<Alloy>
    <TableViewRow height="65" id="disponibleRow">
    </TableViewRow>
</Alloy>

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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