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

Split text of Picker

$
0
0

Hi, i have a picker with values 00:10, 00:20, 00:30, 00:40, 00:50, 01:00,.... they are hours an minutes. I need split the value in Hours and Minutes but i can't. I have the error:

Message: Uncaught TypeError: Object 00 : 10 has no method 'split'

Which is the problem???? Thanks

xml:
 
        <Picker id="picker" top="50%" left="0%" height="40%" width="50%"
            type="Ti.UI.PICKER_TYPE_PLAIN"
            format24="true"
            visibleItems="5"
            horizonalWrap="false"
            useSpinner="true"
            onChange="CambioDesde">
 
            <Column id="PHoraDesde">
                <Row title="  00 : 00  "/>
                <Row title="  00 : 10  "/>
                <Row title="  00 : 20  "/>
                <Row title="  00 : 30  "/>
                <Row title="  00 : 40  "/>
                <Row title="  00 : 50  "/>
 
                <Row title="  01 : 00  "/>
  ..............              
                <Row title="  22 : 00  "/>
                <Row title="  22 : 10  "/>
                <Row title="  22 : 20  "/>
                <Row title="  22 : 30  "/>
                <Row title="  22 : 40  "/>
                <Row title="  22 : 50  "/>
 
                <Row title="  23 : 00  "/>
                <Row title="  23 : 10  "/>
                <Row title="  23 : 20  "/>
                <Row title="  23 : 30  "/>
                <Row title="  23 : 40  "/>
                <Row title="  23 : 50  "/>
 
            </Column>
 
        </Picker>
 
 
 
js:
function CambioDesde(e){
    var Loquehay="";
    var Loquetengo="";
    Ti.API.info('User selected: ' + e.rowIndex+"/"+e.selectedValue+"/");
    Loquetengo=e.selectedValue;
    Loquehay=Loquetengo.split(":");
    Horas=Loquehay[0];
    Minutos=Loquehay[1];
    Ti.API.info('User selected: ' + Horas +"/"+ Minutos +"/");
}

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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