Declined
Last Updated: 11 May 2023 15:16 by David
David
Created on: 05 May 2023 05:32
Category: UI for ASP.NET Core
Type: Bug Report
1
Using jQuery to get a Kendo TabStrip control in a ComboBox change event breaks the TabStrip control

As per the subject, if you use jQuery to get a Kendo TabStrip in a ComboBox change event it inserts this div into the TabStrip control:

<div class="k-tabstrip-items-wrapper k-hstack">
    <ul class="k-tabstrip-items k-reset" role="tablist"></ul>
</div>

This used to work as we were changing the selected tab in a TabStrip based on a ComboBox selection, but this no longer works. Please see the following REPL where a new div is added every time you change the ComboBox value:

https://netcorerepl.telerik.com/mxETafaT24zWOe0C50

Kind regards,

David

 

2 comments
David
Posted on: 11 May 2023 15:16
Great, thanks Mihaela
ADMIN
Mihaela
Posted on: 11 May 2023 10:23

Hello David,

Thank you for taking the time to prepare a REPL sample that replicates the issue.

The unexpected behavior is caused by the kendoTabStrip() method - it initializes a new TabStrip component from the <div> element with the id "tabstrip", which is rendered as a result of the TabStrip HtmlHelper initialization.

To get a reference to the existing TabStrip on the page in the ComboBox Change event handler, you can use either the jQuery data() method or the getKendoTabStrip() method. For example:

  • data() method:
    function onComboChange(e) {
        var tabStrip = $("#tabstrip").data("kendoTabStrip");
        console.log(tabStrip);
    }
  • getKendoTabStrip() method:
    function onComboChange(e) {
        var tabStrip = $("#tabstrip").getKendoTabStrip();
        console.log(tabStrip);
    }

Please update the TabStrip reference in the "onComboChange" function as per any of the examples above and let me know if it works as expected at your end.

 

Regards, Mihaela Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.