Good morning, I currently think of a picker in the following way:
myApp.picker({
input: '#departamento_alterna',
rotateEffect: false,
onClose: function (picker) {
console.log(picker.value)
Cod_depto_alterna = picker.value[0];
$$("#municipio_alterna").val("");
$$("#seccion_alterna").val("");
if (pais == 8) {
if (!Cod_depto_alterna) Cod_depto_alterna = departamentos_codigos[0]
cargarMunicipios(pais, Cod_depto_alterna)
}
},
formatValue: function (p, values, displayValues) {
return displayValues[0];
},
cols: [{
values: departamentos_codigos,
displayValues: departamentos_texto,
textAlign: 'left'
}]
});
Which returns a list of departments, but I must perform the following validation: when a button is checked, the field must be enabled, but when removing checked, this picker must be restarted as well as never selected, since when selecting a value it can not be deselected anymore.
try with $('#departamento_alterna').val("");
but that does not restart it.
Thank you.