How to reset a value of a picker, framework7?


Good morning, I currently think of a picker in the following way:

        input: '#departamento_alterna',
        rotateEffect: false,
        onClose: function (picker) {
            Cod_depto_alterna = picker.value[0];
            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.

asked by JG_GJ 29.08.2018 в 20:56

0 answers