Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (switch)
Viewing all articles
Browse latest Browse all 28

Exclude value="false" switches from Array

$
0
0

I am having trouble finding the correct way to exclude switch result that is set to value="false" from Array result

var checkedlocation = [];
    for(var i = 0, j = FIELDS.length; i< j; i++){
        //Ti.API.info('field: ' + FIELDS[i].id + ', value: ' + FIELDS[i].getValue());
        if(FIELDS[i].value!=='false') 
        checkedlocation.push(FIELDS[i].id + ' Shots');
        checkedlocation.splice(0,'false');
        Ti.API.info(checkedlocation);
    }
and XML
<Widget src="ti.ux.forms.row.switch" title="Findlay" value="false" id=" Findlay"/>
<Widget src="ti.ux.forms.row.switch" title="Sylvania" value="false" id="Sylvania"/>
<Widget src="ti.ux.forms.row.switch" title="Defiance" value="false" id="Defiance"/>

Viewing all articles
Browse latest Browse all 28

Trending Articles