kendo.widgetInstance for radiogroup returns null

1 Answer 147 Views
RadioGroup
Bas
Top achievements
Rank 1
Veteran
Bas asked on 04 May 2022, 08:43 PM | edited on 04 May 2022, 08:44 PM

I have been trying to get the instance of a radiogroup, using kendo.widgetInstance("#radiogroup"), but the call always returns null. Has anyone experienced this issue?

See the example below...


<ul data-role="group" id="radiogroup" name="radiogroupName" class="k-radio-list k-list-horizontal" role="radiogroup"></ul>

...

<script>kendo.syncReady(function(){jQuery("#radiogroup").kendoRadioGroup({items: {...}, value: "...", layout: "horizontal"});});</script>

<script>
...some other script activated by an event...
const widget = kendo.widgetInstance($("#radiogroup"));
...
</script>

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 09 May 2022, 01:23 PM

Hello Bas,

Upon further investigation of the reported behavior I've concluded the observed behavior is a bug. For this reason I have logged a Bug Report on your behalf. You can follow it in our Public Portal here.

That being said until the bug has been fixed I recommend you to use the data method or the getKendoRadioGroup method to access the client-side of the RadioGroup:

$("#radiogroup").data("kendoRadioGroup");

or

$("#radiogroup").getKendoRadioGroup();

Finally as a token of gratitude for bringing this bug to our attention I have updated your Telerik points.

Regards,
Stoyan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
RadioGroup
Asked by
Bas
Top achievements
Rank 1
Veteran
Answers by
Stoyan
Telerik team
Share this question
or