locked
Highlight Tabs (the navigation shortcuts on the form) During Navigation? RRS feed

  • Question

  • I have a customization question that was routed to me from one of out business members about our current CRM 2011 solution. Now that there are 'tabs' on the side of the record for navigation, they would like them to highlight as they scroll through the record so it is easy to see where you are at within the record. Out of the box, they only highlight if you click on the actual 'tab' link.

    Is it possible to have this functionality and would it be supported or not supported?

    Thanks,

    Eric


    • Edited by picsbyeric Thursday, February 28, 2013 9:19 PM
    Thursday, February 28, 2013 8:26 PM

Answers

  • Hi,
    is possible with javascript to achieve what you described, but of course will be unsupported.

    Here you can find a piece of code that implements the functionality (it will not work with IE7,IE8 due to addEventListener, but it works on IE9,Firefox,Chrome, and can always write the code to use attachEvent for IE7 and IE8)

    // add this function to OnLoad event
    function FollowTabs() {
    // first we retrieve how many tabs are inside the form
    var totalTabs = Xrm.Page.ui.tabs.getLength();
    for (indexTab=0;indexTab<totalTabs;indexTab++) {
    	// we retrieve the single tab
    	var currentTab = document.getElementById('tab'+indexTab);
    	// for each tab we add an event when the mouse is over to change the side list style
    	currentTab.addEventListener("mouseover",function() {var l=Xrm.Page.ui.tabs.getLength();for(i=0;i<l;i++){document.getElementById('tab'+i+'Tab').className='ms-crm-FormSelector-SubItem';}document.getElementById(this.id+'Tab').className+=' ms-crm-FormSelector-SubItem-Selected';},false);
    }
    }

    it's only an example and is not optimized neither official supported, but was funny to implement :)

    • Proposed as answer by Guido PreiteMVP Thursday, February 28, 2013 10:08 PM
    • Marked as answer by picsbyeric Monday, March 4, 2013 8:19 PM
    Thursday, February 28, 2013 10:08 PM
  • These shortcuts (subitems at this section) has some actions which works "on click" that when you click on them moves to special part of the fomr. You could even change the colors and other specifications of these shortcuts. However, about the reverse action from the form to the sub items I have no idea. You may add some customizations on the html of the form to work on the motion. But to the best of my knowledge it is unsupported.

    If the answer helped you, remember to mark it as answer.

    • Marked as answer by picsbyeric Monday, March 4, 2013 8:19 PM
    Thursday, February 28, 2013 9:26 PM
    Moderator

All replies

  • What do you mean of tabs? Is it the shortcuts on the form such as general, details etc?

    If the answer helped you, remember to mark it as answer.

    Thursday, February 28, 2013 9:03 PM
    Moderator
  • Yes, the shortcuts.
    Thursday, February 28, 2013 9:17 PM
  • These shortcuts (subitems at this section) has some actions which works "on click" that when you click on them moves to special part of the fomr. You could even change the colors and other specifications of these shortcuts. However, about the reverse action from the form to the sub items I have no idea. You may add some customizations on the html of the form to work on the motion. But to the best of my knowledge it is unsupported.

    If the answer helped you, remember to mark it as answer.

    • Marked as answer by picsbyeric Monday, March 4, 2013 8:19 PM
    Thursday, February 28, 2013 9:26 PM
    Moderator
  • Thank you. That is what I was afraid of.
    Thursday, February 28, 2013 9:58 PM
  • Hi,
    is possible with javascript to achieve what you described, but of course will be unsupported.

    Here you can find a piece of code that implements the functionality (it will not work with IE7,IE8 due to addEventListener, but it works on IE9,Firefox,Chrome, and can always write the code to use attachEvent for IE7 and IE8)

    // add this function to OnLoad event
    function FollowTabs() {
    // first we retrieve how many tabs are inside the form
    var totalTabs = Xrm.Page.ui.tabs.getLength();
    for (indexTab=0;indexTab<totalTabs;indexTab++) {
    	// we retrieve the single tab
    	var currentTab = document.getElementById('tab'+indexTab);
    	// for each tab we add an event when the mouse is over to change the side list style
    	currentTab.addEventListener("mouseover",function() {var l=Xrm.Page.ui.tabs.getLength();for(i=0;i<l;i++){document.getElementById('tab'+i+'Tab').className='ms-crm-FormSelector-SubItem';}document.getElementById(this.id+'Tab').className+=' ms-crm-FormSelector-SubItem-Selected';},false);
    }
    }

    it's only an example and is not optimized neither official supported, but was funny to implement :)

    • Proposed as answer by Guido PreiteMVP Thursday, February 28, 2013 10:08 PM
    • Marked as answer by picsbyeric Monday, March 4, 2013 8:19 PM
    Thursday, February 28, 2013 10:08 PM