Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
toggle a switch to off when interacting with another In a nativescript

I'm trying when I interact with a switch the others go to false can anyone help? XML code:

                <StackLayout dock="top" height="90%" width="100%" style="">
                <StackLayout tap="{{ definicoesTap }}" >
                    <Label text="    Voltar" paddingLeft="15%" class="drawerItemText font-awesome" />
                </StackLayout>
                <StackLayout class="hr-light"></StackLayout>
                <StackLayout orientation="horizontal" marginTop="20" marginLeft="20">
                    <Switch id="notOFF" checkedChange="{{ teste }}" checked="False"/>
                    <Label text="Desativar todas as notificações" style="color:#000;font-size:17" marginLeft="5" />
                </StackLayout>
                <StackLayout orientation="horizontal" marginTop="20" marginLeft="20">
                    <Switch id="notON" checkedChange="{{ teste }}" checked="False"/>
                    <Label text="Ativar todas as notificações" style="color:#000;font-size:17" marginLeft="5" />
                </StackLayout>
                <StackLayout orientation="horizontal" marginTop="20" marginLeft="20">
                    <Switch id="notSMS" checkedChange="{{ teste }}" checked="False"/>
                    <Label text="Ativar apenas mensagens" style="color:#000;font-size:17" marginLeft="5" />
                </StackLayout>
                <StackLayout marginTop="20">
                    <Button text="Confirmar" tap="{{ definicoesTap }}" class="btn btn-secundary m-t-20" />
                </StackLayout>
            </StackLayout>

I created a function that executes when I activate the switches, now i want when 1 is true the others would be false JavaScript Code:

viewModel.teste = (args) => {
var objeto = args.object;
if (objeto.checked == true) {

    switch (objeto.id) {
        case "notOFF":
            console.log("Todas as notificações desligadas")
            break

        case "notON":
            console.log("Todas as notificações ligadas")
            break

        case "notSMS":
            console.log("Apenas as notificações das mensagens")
            break
    }
}

}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!