Hi,
I have a problem with ejs-radiobuton.
Behaves like a checkbox. when clicked instead of deselecting the radio previously selected one it remains selected. So if a have four radio options and a click for times all radio are checkd. I use a v-for to show the values. How can I fix this?
<template>
<div id="app">
<ul v-for="user_status in status_radio_buttons" :key="user_status.text">
<ejs-radiobutton
:label="user_status.text"
name="defaults"
:value="user_status.text"
></ejs-radiobutton>
</ul>
</div>
</template>
<script>
import Vue from "vue";
import { enableRipple } from "@syncfusion/ej2-base";
import { RadioButtonPlugin } from "@syncfusion/ej2-vue-buttons";
Vue.use(RadioButtonPlugin);
enableRipple(false);
export default Vue.extend({
data: function () {
return {
status_radio_buttons: [
{ text: "Active", value: true },
{ text: "Inactive", value: false },
{ text: "normal", value: false },
{ text: "difficult", value: false },
],
};
},
});
</script>
|
We use a v-for in a v-for, I can save the date corectly, the issue is that on click it dosen't deselect the previous checked option.
This are the values that are passed to the ejs-radiobuton : [ "en", "de", "fr", "es" ]
<ul v-for="user_status in status_radio_buttons" :key="user_status.text">
<ejs-radiobutton
:label="user_status.text"
name="defaults"
:change="radioChange"
:value="user_status.text"
:ref="user_status.text"
></ejs-radiobutton>
</ul>
. . .
methods: {
radioChange: function (args) {
console.log(args.value);
console.log(this.$refs[args.value][0].value);
},
},
|
We have create a function that create a object and than returns it to the v-for. It's working, thank you.
We have face another issue now, we try to implement custom design to checkbox for example. we write the css from the component, the problem is that the css is overwritten by the fabric.css
.e-radio:checked + label::before {
background-color: #fff;
border-color: green;
}
.e-radio:checked + label::after {
background-color: green;
color: green;
}
|