jeudi 3 septembre 2020

how to use devexpress checkbox like radiobutton realtime in mvc

i have 2 checkboxes html with devexpress. i want to use this devexpress checkboxes like radiobutton in realtime.

so when user click one checkbox, another checkboxes will be unchecked.

    <div>
         @Html.DevExpress().CheckBoxFor(x => x.CBComplete, settings =>
         {
             settings.Text = "Complete";
         }).GetHtml()
   </div>
   <div>
         @Html.DevExpress().CheckBoxFor(x => x.CBPartial, settings =>
         {
             settings.Text = "Partial";
         }).GetHtml()
   </div>

I also try this javascript method but not working

$(document).ready(function () {
    debugger;
    $("#CBComplete").change(
        function (e) {
            debugger;
            $("#CBPartial").attr('checked',!this.checked);
      }
    );
    debugger;
    $("#CBPartial").change(
        function (e) {
            debugger;
            $("#CBComplete").attr('checked',!this.checked);
      }
    );
});



Aucun commentaire:

Enregistrer un commentaire