This is a migrated thread and some comments may be shown as answers.

[Solved] Client Events popping in all controls

3 Answers 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vlad Bulkin
Top achievements
Rank 1
Vlad Bulkin asked on 13 Apr 2011, 11:17 PM
After upgrading to 2011.1.315 we encountered a strange issue: client-side events like onSelect would be triggered in multiple controls on the page, like they are bubbling up.

I created a basic project using Telerik template for MVC3, put a menu and a tabstrip on a page, and wired their onSelect events each to a different handler:

             <%: Html.Telerik().Menu()
                    .Name("menu")
                    .ClientEvents(e => e.OnSelect("mnuOnSelect"))
                    .Items(menu => {
                        menu.Add().Text("Menu1");
                        menu.Add().Text("Menu2");
                    })
            %>  
   
    <%: Html.Telerik().TabStrip()
            .Name("tabs")
            .ClientEvents(e => e.OnSelect("tabsOnSelect"))
            .Items(tabs => {
                tabs.Add().Text("Tab1");
                tabs.Add().Text("Tab2");
            })
      %>
    <script type="text/javascript">
        function mnuOnSelect(e) {
            alert("mnuOnSelect");
        }
        function tabsOnSelect(e) {
            alert("tabsOnSelect");
        }
    </script>

What happens is when i click on a menu item - only mnuOnSelect is firing, which is what you would expect.

However if a tabstrip is clicked, it fires tabsOnSelect and then mnuOnSelect.

Any clue on what is going on here? For this stripped down project I am using jQuery 1.4.4

Thank you!
Vlad

3 Answers, 1 is accepted

Sort by
0
Matthew Ruston
Top achievements
Rank 1
answered on 20 Apr 2011, 08:22 PM
I an confirm I am getting a similar issue. Mine is occuring on a page where I have a both a Telerik Menu and TreeView control. The client event (JavaScript function) registered to the OnSelect for the Menu fires when I click on items in my TreeView. Even though the TreeView does not have any client events explicitly registered.

Using Telerik.Web.Mvc 2011.1.315.340 with ASP.net MVC3 for the record.

I also was able to reproduce the issue in the example given by Vlad on my version.
0
Alex Gyoshev
Telerik team
answered on 22 Apr 2011, 09:43 AM
Hello Matthew, Vlad,

Thank you for reporting this issue. We just fixed it, and the attached telerik.menu.min.js should solve this for you.

Kind regards,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vlad Bulkin
Top achievements
Rank 1
answered on 22 Apr 2011, 08:50 PM
Thanks for the fix, works great!
Tags
General Discussions
Asked by
Vlad Bulkin
Top achievements
Rank 1
Answers by
Matthew Ruston
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Vlad Bulkin
Top achievements
Rank 1
Share this question
or