This is a migrated thread and some comments may be shown as answers.
Disabled menu items can be clicked
7 Answers 55 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
abodnar
Top achievements
Rank 1
abodnar asked on 08 Sep 2010, 04:06 PM
After upgrading to 2010.2 825 I'm seeing that disabled menu items appear disabled but the user is able to click on them.  Is anyone else seeing this behavior?

7 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 09 Sep 2010, 03:41 PM
Hello abodnar,

Thank you for pointing this issue to us.

I confirm it as a bug. Fix will be included in the next official release of the Telerik Components for ASP.NET MVC. In order to fix it locally you need to change update click method in telerik.menu.js file:

[in telerik.menu.js]:
click: function (e, element) {
    e.stopPropagation();
 
    var $li = $(element);
 
    if ($li.hasClass('t-state-disabled')) {
        e.preventDefault();
        return;
    }
 
    $t.trigger(this.element, 'select', { item: $li[0] });
 
    if (!$li.parent().hasClass('t-menu') || !this.openOnClick)
        return;
 
    e.preventDefault();
 
    this.clicked = true;
 
    this.triggerEvent('open', $li);
 
    this.open($li);
},

I have updated your Telerik points.

All the best,
Georgi Krustev
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
abodnar
Top achievements
Rank 1
answered on 09 Sep 2010, 06:26 PM
Hi Georgi,

Thank you for your reply.  I'm still seeing some odd behavior with the menu items which is preventing your proposed fix from working correctly.  I've used Firebug to confirm that the disabled menu item does have the class 't-state-disabled', but when I click on the disabled menu item, the class for the referenced element in the click() function is 't-item t-state-default' Any ideas?
0
Georgi Krustev
Telerik team
answered on 10 Sep 2010, 09:28 AM
Hello abodnar,

There were several changes in the telerik.menu.js file. In order to avoid any misunderstandings I have attached the telerik.menu.js file with the fix.

Regards,
Georgi Krustev
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
a c
Top achievements
Rank 1
answered on 15 Sep 2010, 06:43 AM
You can also modify the source code NavigationHtmlBuilderBase.cs:
        public IHtmlNode LinkTag(TItem item, Action<IHtmlNode> configure)
        {
            var url = Component.GetItemUrl(item) ;
           ....
Changed to:
        public IHtmlNode LinkTag(TItem item, Action<IHtmlNode> configure)
        {
            var url = item.Enabled ? Component.GetItemUrl(item) : "#";
           ....

0
Carson
Top achievements
Rank 1
answered on 29 Dec 2010, 07:35 PM
@a c
Thanks! That saved me a ton of time.
0
Mike
Top achievements
Rank 1
answered on 13 Jul 2011, 02:43 PM
Can i the minified version?  Or has this been release yet?
0
Atanas Korchev
Telerik team
answered on 14 Jul 2011, 07:31 AM
Hi Mike,

 The latest official release should include the fix.

Greetings,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Menu
Asked by
abodnar
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
abodnar
Top achievements
Rank 1
a c
Top achievements
Rank 1
Carson
Top achievements
Rank 1
Mike
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or