Topic: MDB-INPUT checkbox
Petr Urban priority asked 5 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
Mafick free answered 5 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 5 years ago
It was fixed in the latest release (5.1.1).
Best regards
Mikołaj Smoleński staff answered 5 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
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- 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