0

In the Vf page where I created a tab. I want to make enable or disable if the checkbox is true.but my code is not working

here is my code:

 <li class="slds-tabs_scoped__item tabs_scoped-li-2" title="Documents" role="presentation"><a style="text-decoration:none;" class="slds-tabs_scoped__link" href="javascript:onChangeTab('2');" role="tab" tabindex="-1" aria-selected="false" aria-controls="tab-scoped-2" id="tab-scoped-2__item" disabled ="{!IF(mfdConfigSetting.Documents_Tab_View__c== true , false, true)}">Documents</a></li>

javascript code which is used here is:

 function onChangeTab(tabName){
        j$('#selected-record').html('');
        j$('#dvDownloadFileDetails').hide();
        clearJavascriptMessage();
        j$('.slds-tabs_scoped__item').removeClass('slds-is-active');
        j$('.slds-tabs_scoped__item a').attr('aria-selected', 'false');
        j$('.tabs_scoped-li-' + tabName).addClass('slds-is-active');
        j$('#tab-scoped-'+ tabName + '__item a').attr('aria-selected', 'true');
        j$('.slds-tabs_scoped__content').hide();
        j$('#tab-scoped-' + tabName).fadeIn(1000);

        if(tabName == '2') {
            if(!{!$ObjectType.Document.accessible}){
                j$('#tab_dvDocuments').hide();
                showInfoMessage('You don\'t have access to Document object. Please ask your System Administrator to grant you access to the same.');
                return;
            } else {
                getAllDocumentsByFolder();
            }

to make tab disabled i didn't use a javascript function i used only disabled ="{!IF(mfdConfigSetting.Documents_Tab_View__c== true , false, true)}" here Documents_Tab_View__c is a checkbox

1
  • The above mention javascript I used in href that's why I put here
    – Hennry
    Jan 13, 2019 at 14:04

1 Answer 1

0

disabled only applies to input elements (input, select), not things like li or other presentation elements. Ideally, you'd probably just use slds-hide to hide the tab or use some other technique. SLDS does not have a process for showing disabled tabs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .