Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda