Hi!
I'm using the metronic template. I need a tristate "switch" or checkbox to represeent "true", "false", and null.
Is there anything like it in the Metronic portfolio of controls? I checked the documentation and I have not seen it.
Hi,
May I know which Metronic version are you using? Please consider using the latest Metronic v8.1.7 and we can provide you a custom code to implement indeterminate
state as shown in the Bootstrap docs. This fix will be added to the next update of Metronic - v8.1.8.
To make implement indeterminate in Metronic v8.1.7:
1) In src/sass/components/_variables.scss
set the checkbox indeterminate variables as below:
$form-check-input-indeterminate-color: $component-checked-color !default;
$form-check-input-indeterminate-bg-color: $component-checked-bg !default;
$form-check-input-indeterminate-border-color: $component-checked-bg !default;
src/sass/components/forms/_form-check.scss
change the checkbox solid state code as below:// Solid
&.form-check-solid {
.form-check-input {
border: 0;
&:not(:checked):not(:indeterminate) {
background-color: $form-check-input-bg-solid;
}
}
}
document.querySelector("#kt_check_indeterminate_1").indeterminate = true;
that worked great! thank you very much
Hi ,
Glad to help you out and thank you for the heads up on this. We helped us to improve Metronic with this new option.
Regards.