function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Srinivasulu RecruitingSrinivasulu Recruiting 

Can we remove global header section from Lightning Pages

Does anyone have any pointer for tweaking this section?​
User-added image
Srinivasulu RecruitingSrinivasulu Recruiting
If yes please provide me code.
Srinivasulu RecruitingSrinivasulu Recruiting
Hi  Sitanshu Tripathi,

Thank you for your response.

I have written code like this. Can you please assist.
 
Component:
<aura:component Implements="force:appHostable">
    <aura:handler name="init" value="{!this}" action="{!c.afterRender}" />

</aura:component>

Controller.JS:

({
	// Your renderer method overrides go here
 afterRender: function (component, helper) {
    this.superAfterRender();
    // interact with the DOM here       

    //Full Header
    //document.getElementsByClassName('slds-grid--align-spread')[1].style.display='none';

    //Search Bar
    document.getElementsByClassName('slds-global-header__item--search')[1].style.display='none';
} 
})

I have added that component to lightning tab and I'm getting below error.Please find the attachment.User-added image
Action failed: c:Setup$controller$afterRender [Cannot read property 'superAfterRender' of undefined]


 
Srinivasulu RecruitingSrinivasulu Recruiting
Can anyone help on above requirement?
Raj VakatiRaj Vakati
Move the below code from the Component controller to Render. 
 
afterRender: function (component, helper) {
    this.superAfterRender();
    // interact with the DOM here       

    //Full Header
    //document.getElementsByClassName('slds-grid--align-spread')[1].style.display='none';

    //Search Bar
    document.getElementsByClassName('slds-global-header__item--search')[1].style.display='none';
}

User-added image

 
Sitanshu TripathiSitanshu Tripathi
Dear Srinivasulu Recruiting,
I have not knowledge about 2nd question but for your first question I search and text you previous answer, If that is helpful little then please like my affert.
Srinivasulu RecruitingSrinivasulu Recruiting
Hi  All,

I am still facing issue.Please see the error of the screen shot and code. Please assist me.User-added image
Component:
<aura:component Implements="force:appHostable">
      <aura:handler name="init" value="{!this}" action="{!c.afterRender}" />
   
</aura:component>


Renderer:

({
	// Your renderer method overrides go here
 afterRender: function (cmp, helper) {
    this.superAfterRender();
    // interact with the DOM here       

    //Full Header
    document.getElementsByClassName('slds-grid--align-spread')[1].style.display='none';

    //Search Bar
    document.getElementsByClassName('slds-global-header__item--search')[1].style.display='none';
} 
})
Thanks,
Srini