web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :

Scroll a CRM 2011 Tab to the top when is expanded

Guido Preite Profile Picture Guido Preite 54,086 Moderator
Tailoring CRM 2011 Forms to customer needs often brings unusual requirements. What can we do if the user wants to automatically scroll a tab to the top when is expanded? We can use this function:

function ScrollTabToTop(executionObj) {
// retrieve the current tab
var currentTab = executionObj.getEventSource();
// check if the click made the tab to be expanded
if (currentTab.getDisplayState() == "expanded") {
// set the focus to the current tab
currentTab.setFocus();
}
}
The function needs to be attached to the TabStateChange event for all the tabs.
Because the function use the Execution Context, is necessary to select the checkbox "Pass execution context as first parameter" when we add the handler:

This was originally posted here.

Comments

*This post is locked for comments