vendredi 29 mars 2019

Uncheck radiofield

I need to click on a radiofield and check it, click another time on the same radiofield and uncheck it.

My code doesen't work because the getChecked() is always true! This is my function, triggered on click event

                        listeners: {
                            click: {
                                element: 'element',
                                fn: function (event, target) {
                                    var radioField = this.component;
                                    if (radioField.getChecked()) {
                                        radioField.setChecked(false);
                                    }
                                    else {
                                        radioField.setChecked(true);
                                    }
                                }
                            }
                        },




Aucun commentaire:

Enregistrer un commentaire