Sub-Tab focus from Display to Edit form
We have a form that contains parent tabs with child (sub-tabs) inside the parent to help organize the information. Is there a way to maintain the focus on the tab that was activated on the Display Form when opening up the Edit Form?
For example, user navigates to the Display form and clicks on parent Tab B and Subtab 3. If the user clicks Edit to open up the respective edit form, can it automatically activate parent Tab B, Subtab 3?
For example, user navigates to the Display form and clicks on parent Tab B and Subtab 3. If the user clicks Edit to open up the respective edit form, can it automatically activate parent Tab B, Subtab 3?
Add the following code to your form (for all view types where you want to have this functionality: Display, Edit, New?)
Code: Select all
var contextID = _spPageContextInfo.pageListId+':'+GetUrlKeyValue('ID');
for (id in fd_tabcontrol_ids){
if (typeof $.cookie("#"+fd_tabcontrol_ids[id]+":"+contextID) !== 'undefined') {
$("#"+fd_tabcontrol_ids[id]).tabs('option', 'active', $.cookie("#"+fd_tabcontrol_ids[id]+":"+contextID));
};
$.cookie("#"+fd_tabcontrol_ids[id]+":"+contextID, $("#"+fd_tabcontrol_ids[id]).tabs('option', 'active'));
$("#"+fd_tabcontrol_ids[id]).on( "tabsactivate", function( event, ui ) {
if(this === event.target)
{
$.cookie('#'+event.currentTarget.id+':'+contextID, ui.newTab.index());
}
} );
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 26 guests