Topic: MDB-INPUT checkbox
Petr Urban pro premium priority asked 6 years ago
Hi there,how can i properly programatically check or uncheck checkbox and the value please? I want to restore the previous state of the checkboxes base on localStorage values.
if (localStorage.uploadNotSupported) { this.uploadNotSupported = JSON.parse(localStorage.uploadNotSupported); }
if (localStorage.uploadNotSupportedChecked) { this.uploadNotSupportedChecked = JSON.parse(localStorage.uploadNotSupportedChecked); }
Why the checkbox @change method is called during the page is rendered? Because of this I must set the initial values in opposite way, e.g.
uploadNotSupported: true,
uploadNotSupportedChecked: false
uploadChange() {
this.uploadNotSupported = !this.uploadNotSupported;
this.uploadNotSupportedChecked = !this.uploadNotSupportedChecked;
},
Thanks,Petr
Mikołaj Smoleński staff answered 6 years ago
Hi Petr,
I've just fix the issue with emitting input's change event. It is on our #dev branch and will be released on Monday.
Best regards
Mafick answered 6 years ago
Hello,
Was this fixed in version 4.7.4 ? Cause I have the same problem, that the checkboxes by itself are working. But they dont show the current value from the Backend. So they are always false when I load the page.
BR
Mikołaj Smoleński staff commented 6 years ago
It was fixed in the latest release (5.1.1).
Best regards
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB Vue
- MDB Version: 5.1.0
- Device: MacBook
- Browser: Safari
- OS: Mac OS
- Provided sample code: No
- Provided link: No