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
SwayampravaSwayamprava 

Freeze the pageblock table (with scroll bar) header.

Hi

I have a pageblock table on a Vf page with a scrollbar.

 

please anybody can help me to fix the header.

 

I know it is possible through java script. So if anybody  can share the javescript with me?

 

Navatar_DbSupNavatar_DbSup

Hi,

Try the below code snippet as reference:

<apex:page standardController="Opportunity" recordSetVar="opportunities">

  <apex:form >

    <apex:pageBlock >

      <apex:pageMessages />

      <apex:pageBlockButtons >

        <apex:commandButton value="Save" action="{!save}"/>

      </apex:pageBlockButtons>

      <apex:outputpanel style="overflow:scroll;height:250px;" layout="block">

      <apex:pageBlockTable value="{!opportunities}" var="opp">

        <apex:column value="{!opp.name}"/>

        <apex:column headerValue="Stage">

          <apex:inputField value="{!opp.stageName}"/>

        </apex:column>

        <apex:column headerValue="Close Date">

          <apex:inputField value="{!opp.closeDate}"/>

        </apex:column>

      </apex:pageBlockTable>

      </apex:outputpanel>

    </apex:pageBlock>

  </apex:form>

</apex:page>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

SwayampravaSwayamprava

Hi ,do u need to mention the below style.

 

<apex:outputpanel style="overflow:scroll;height:250px;" layout="block">

 

Thanks for your reply. But already i have tried this . This is only to put a scroll bar , not to freeze the header.  I know that it is possible using a j query. but i donot have any idea about jquery.

vriavmvriavm

Hi,

 

     U need to use this to achieve scollable header:

            http://jeromebulanadi.wordpress.com/2010/03/22/scrollable-fixed-header-table-a-jquery-plugin/

      I implemented in VF pages and works great.

 

Thanks & Regards,

Vivek V.