Error when using radiobutton controls

Hi everyone,

I have an error when I try to use radiobutton control. Can you help me? 


This is what it say:

Uncaught TypeError: ejs.buttons.RadioButton is not a constructor


new ejs.buttons.RadioButton({  
"checked": true,  
"label": "Credit/Debit Card",  
"name": "payment",  
"value": "credit/debit"}).appendTo("#radio1");

​


3 Replies

AS Aravinthan Seetharaman Syncfusion Team June 25, 2021 10:14 AM UTC

Hi Francesco, 
 
Thanks for contacting Syncfusion Support. 
 
We have checked your query in our latest version 19.1.69. We cannot reproduce your reported issue in our end. For your reference we have prepared video demo, code snippet and sample. 
 
 
index.cshtml 
 
<input id="radio1" type="radio" /> 
<input id="radio2" type="radio" /> 
<script> 
    new ejs.buttons.RadioButton({ 
        "checked": true, 
        "label": "Credit/Debit Card", 
        "name": "payment", 
        "value": "credit/debit" 
    }).appendTo("#radio1"); 
    new ejs.buttons.RadioButton({ 
        "label": "Net Banking", 
        "name": "payment", 
        "value": "netbanking" 
    }).appendTo("#radio2"); 
</script> 
 
 
 
However we suspect that you are not properly installed our Syncfusion.EJ2.AspNet.Core nuget package. So, please install the package from the below link and then check your issue.. 
 
Nuget: https://www.nuget.org/packages/Syncfusion.EJ2.AspNet.Core/19.1.0.69?_src=template

For more details, please refer the below link. 
 
 
 If you are still facing the issue, kindly share the below details. 
 
·         If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample. 
·         Please share us the video demonstration of this issue. 
·         Please share us the Nuget package version. 
 
Please provide the above requested information, based on that we will check and provide you a better solution quickly. 
 
Regards, 
Aravinthan S


UN Unknown Syncfusion Team June 30, 2021 01:05 PM UTC

Thank you for your quick response.


I'm using Visual Studio 2019 with package Syncfusion.EJ2.AspNet.Core 18.3.0.53 ​installed from NuGet Package Manager.

Some controls like ListView, TextBox, Datepicker work fine, others give me some problems.


Here is my code:


<div class="form-group row">

     <div class="col-md-12">

          <div class="input-group">

               <ejs-calendar id="calendar" value="@Model.SelectedData.ToString("yyyy-MM-dd")" change="valueChange"                     renderDayCell="customDates" showTodayButton="false" firstDayOfWeek=1></ejs-calendar>

         </div>

     </div>

</div>


 <ejs-radiobutton id="radio1" label="Option 1" name="default"></ejs-radiobutton>

 <ejs-radiobutton id="radio2" label="Option 2" name="default" checked="true"></ejs-radiobutton>


@await Html.PartialAsync("~/Views/Shared/EJ2Library.cshtml")


In my PartialView ~/Views/Shared/EJ2Library.cshtml I have:


<link rel='nofollow' href="~/js/ej2/bootstrap.css" rel="stylesheet" type="text/css" />

<script src="~/js/ej2/ej2.min.js" type="text/javascript"></script>

<ejs-scripts></ejs-scripts>


<script>

    function changeCulture(cul) {

        ej.base.setCurrencyCode("EUR");

        ej.base.setCulture(cul);

    }


    var locale = new ej.base.Ajax('/js/ej2/locale.json', 'GET', false);

    locale.send().then(function (value) {

        ej.base.L10n.load(JSON.parse(value));

    });


    var ajax = new ej.base.Ajax('/js/ej2/all.json', 'GET', false);

    ajax.send().then(function (result) {

        ej.base.loadCldr(JSON.parse(result));

        changeCulture("it");

    });

</script>


Thank you,

Francesco



AS Aravinthan Seetharaman Syncfusion Team July 2, 2021 03:57 AM UTC

 
We have checked your query in the version 18.3.53. We cannot reproduce your reported issue in our end. For your reference we have prepared sample in the version 18.3.53. Please find the sample link below. 
 
 
If you are still facing the issue, kindly share the below details. 
 
·         If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample. 
·         Please remove all controls other than RadioButton from your application and let us know if you’re facing issue.  
·         Please share us the video demonstration of this issue. 
·         Please share us the error callstack details of this issue. 
 
Please provide the above requested information, based on that we will check and provide you a better solution quickly. 
 
Regards, 
Aravinthan S

Loader.
Up arrow icon