Excel like 'Freeze column header' functionality in sharepoint OOB list view webpart

Hi,
I have OOB external list dropped on a page as listview webpart. It contains many records and hence while scrolling down headers are no available, hence it should freeze all column headers while scrolling down the page. Its directly dragged and dropped
on site page hence no server side formatting can be done.
Is there any way we can apply some client side script to freeze column headers to listview webpart while scrolling down? or any settings that can be done to acheive this?
Thanks in advance.
Regards,
Rahul

Hi Rahul,
Normal techniques for freezing the header row of an HTML table tend to fall short when it comes to SharePoint 2010 lists due to the lack of THEAD elements.
You can try something like this, although you may want to test it in various browsers in case the column heading alignment is off.
<style>
.ms-viewheadertr{background-color:white;}
</style>
<script>
/* wrap the table in a div, set its height, give it scrollbars, and move it down */
var myTable = document.querySelector(".ms-listviewtable");
var wrapperDiv = document.createElement('div');
wrapperDiv.setAttribute("ID","FreezePaneWrapper");
wrapperDiv.setAttribute("style","OVERFLOW: auto; HEIGHT: 400px; padding-top:38px;");
wrapperDiv.appendChild(myTable.cloneNode(true));
myTable.parentNode.replaceChild(wrapperDiv,myTable);
/* Freeze the header row and move it up*/
var headerRow = document.querySelector(".ms-viewheadertr");
document.getElementById("FreezePaneWrapper").style.width = "" + headerRow.scrollWidth + "px";
headerRow.style.width = "" + headerRow.scrollWidth + "px";
headerRow.style.position = "absolute";
headerRow.style.top = ""+(headerRow.offsetTop-39)+"px";
/* Tell the header's columns to be the same width as the cells in the first "alternating" row */
var columns = document.querySelector("table.ms-listviewtable tr.ms-alternating").querySelectorAll("tr>td");
headers = document.querySelectorAll("tr.ms-viewheadertr th");
for(var i = 0; i < headers.length; i++){
if(columns[i].scrollWidth > headers[i].scrollWidth){
headers[i].style.width = ""+columns[i].scrollWidth + "px";
}else{
columns[i].style.width = ""+headers[i].scrollWidth + "px";
</script>
Edit: Also, you may want to inspect the HTML attributes on the external list view to be sure the class names match up with the querySelector parameters above. Specifically, the table should have a class of "ms-listviewtable", the header row should
have a class of "ms-viewheadertr", and rows of alternating background color should have a class of "ms-alternating".
If any of those are different in your case, you may be able to adjust the above code accordingly.

Similar Messages

  • SharePoint Online list view threshold issues: "because it exceeds the list view threshold enforced by the administrator"

    SharePoint Online list view threshold issues: "because it exceeds the list view threshold enforced by the administrator"
    Office 365 SharePoint Online can be problematic when it comes to exceeding the list item threshold (e.g. 5,000).
    Examples of what happens after exceeding the threshold (e.g. 5,000 items):
    You can’t create new forms for the list in SharePoint Designer.
    You may have challenges with metadata fields in the forms (e.g. adding metadata values, editing metadata values, deleting the metadata column from the list).
    Cannot save the list as a template (i.e. you get the threshold error).
    Issue I'd like assistance with: how can I create a custom NewForm in SharePoint Designer
    when the list exceeds the threshold limit, given this is Office 365 SharePoint Online and I don't have access to increase that limit?
    As a control for my testing, I created another list with just a few custom columns with no list items --it worked fine for that list.
    I also tried clearing local AppData cache which didn't solve it. I'd need Central Admin on O365 SharePoint Online to increase the threshold which I don't have access
    to do. Errors received in SharePoint Designer:
    "Could not save the list changes to the server." After getting this, I tried to work around
    the create new forms issue by saving a copy of the original NewForm as NewForm2 and got the root error that I suspected was underlying it all:
    “Server error: the attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator”.
    Any ideas for how to create a new list form in SD?

    Thanks Alex.
    I just found a couple new workarounds instead of using SharePoint Designer:
    Method 1: Add web parts to the form pages on the client side:
    Go to the list and execute one of these actions depending what form you want to edit: create a new item (NewForm), edit an item (EditForm), or display an item (DispForm).
    With the form you want to edit displayed, go to the gear icon and click "Edit Page".
    You should now see the web part page show up with "Add a Web Part" as an option.
    Add a Content Editor or Script Editor web part.
    Add your custom code to either one to manipulate the HTML objects using your favorite web languages.
    Method 2: Use InfoPath 2013.
       The InfoPath 2013 route appears to work.

  • Controls in ITEM and LIST tabs of Ribbon disabled always in Punishing SharePoint 2013 site if i add list to home page as List View Webpart

    Hi,
    Below is the scenario,
    If i created any custom list and navigating to the list (AllItems.aspx) and on selecting the item, i can see controls in ITEM and LIST tabs of Ribbon are enabled in SharePoint 2013 publishing site.
    If i add the same list in the home page (add web part --> select list view webpart) in the publishing site, on selecting of item, all controls in ITEM and LIST tabs of Ribbon are disabled always.
    Please help me to fix this issue ASAP.
    Regards,
    Krishna

    Hi,
    Thanks for your reply.
    Ribbon controls (only ITEM and LIST tab) still in disabled mode even if i selected the item in the list view webpart.
    Also, i have noticed the below things,
    when i create a published site (default page : default.aspx) and add the list view webpart in the default page, the controls are in disabled mode on selecting item in list view webpart.
    when i create a team site (default page : home.aspx) and add the list view webpart in the default page, the controls are in enable mode on selecting item in list view webpart.
    Please help me on this.
    Regards,
    Krishna

  • SharePoint 2010 list view - How to filter on a multiline text box field - the view filter does not allow me to select it.

    Hi there,
    Does someone know in SharePoint 2010 list view - How to filter on a multiline text box field - the view filter does not allow me to select it.
    Thanks,

    Hi,
    Per my knowledge,
    it is by design that the data type multiple lines of text can only use “contains” and “begins with” operators.
    You can also filter the list view using SharePoint Designer,
    Open your list AllItem.aspx page in SPD ->click “Filter” > in “Field Name” select your multipe line of text field, in “Comparison” will displayed four choices.
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • SharePoint 2013 Online : Custom List view xslt webpart UI vs List View WebPart UI with search ? How to create a xslt list view webpart same UI as list View webpart ???

    I have created a xslt list view webpart but I does not have UI as SharePoint 2013 list view UI.
    how I can have it.
    Ahsan Ranjha

    Hi Ahsan,
    According to your description, my understanding is that the UI is different between XSLT web part and List View web part.
    Per my knowledge, the List View web part is a kind of the XSLT list view web part which uses XSLT to display data on the page.
    http://sharepoint-videos.com/list-view-and-data-view-web-parts/
    How did you add the XSLT web part and the List View web part?
    Could you please provide a screenshot of the two web parts?
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Sharepoint 2013 list view quick edit does not work with out remote API permissions

    sharepoint 2013 list view quick edit does not work with out remote API permissions.
    When I give Use Remote Interfaces  -  Use SOAP, Web DAV, the Client Object Model or SharePoint Designer interfaces to access the Web site it works which is not an ideal situation..
    MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

    This is true. If you use Fiddler to watch the requests from the list view quick edit you can see CSOM calls. For example when changing a value in a cell, when you tab out you will see the SetFieldValue and Update method calls on the list item.
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Download internal table data into excel sheet with column heading and data

    Hi,
      I am having one internal table with column headings and other table with data.
    i want to download the data with these tables into an excel sheet.
    It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
    Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
    what we have to do for storing the file name in runtime.
    Can anyone help me on this.
    Thanks,
    Rose.

    Hi Camila,
        Try this
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = PATH2
       FILETYPE                        = 'XLS'
      TABLES
        DATA_TAB                        = IT_DATA
       FIELDNAMES                      = IT_HEADINGS
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22

  • IR Report Freeze Column Header Row

    In Interactive Report, Can we freeze the column header row ? This is a most wanted requirement asked by customers. More than 50 times requested in past month.
    Please help

    I have been playing with this problem and came up with this potential solution that has so far worked for me.
    Caveats: I am new to this type of coding so check it carefully. It only works with Internet Explorer (its what we use at work). I hope to have a Firefox version someday. Some code used was found online. I gave it proper credit in my usage.
    Instrcutions:
    In the HTMLHeader of the Edit Page, paste the code shown below. It will lock/freeze the header of an interactive report and (optionally), any number of columns to the left of the report.
    To customize it for your needs,
    1. edit the line that reads: var LOCKED_COLUMNS=2; to reflect the number of columns to be locked (0 won't lock anycolumns)
    2. edit the style section that reads:
    <code>
    div#apexir_DATA_PANEL
    width: 300px; height=200px; overflow: scroll; position:relative; float:left;
    </code>
    to reflect the width and height for you scrolling window.
    3. optionally turn of the pagination (under Pagination in the Report Attribute pagefor the region) if you want to scroll through your entire dataset without paging [possible performance implications].
    I tested this with Apex 3.2 and with several themes (1, 3 and8). Hopefully it will work for you.
    The code follows:
    =====================================
    <code>
    <script>
    // This code copied from: http://javascript.about.com/library/bldom08.htm
    document.getElementsByClassName = function(cl)
    var retnode = [];
    var myclass = new RegExp('\\b'+cl+'\\b');
    var elem = this.getElementsByTagName('*');
    for (var i = 0; i < elem.length; i++)
    var classes = elem.className;
    if (myclass.test(classes)) retnode.push(elem[i]);
    return retnode;
    // End of code copied from: http://javascript.about.com/library/bldom08.htm
    var LOCKED_COLUMNS=2;
    function applyCSS()
    var data_Table=document.getElementsByClassName('apexir_WORKSHEET_DATA');
    var tr_Tags=data_Table[0].getElementsByTagName('tr');
    for (var i=0;i<tr_Tags.length;i++)
    var tab_Cells=tr_Tags[i].childNodes;
    for (var j=0; j<LOCKED_COLUMNS; j++)
    if (tab_Cells[j].nodeName != 'TD')
    { tab_Cells[j].setAttribute('id', 'Lock_Lateral_Vertical'); }
    else
    { tab_Cells[j].setAttribute('id', 'Lock_Lateral'); }
    window.onload=applyCSS;
    </script>
    <!--[if IE]>
    <style id="Lock_CSS">
    div#apexir_DATA_PANEL
    width: 300px; height=200px; overflow: scroll; position:relative; float:left;
    table.apexir_WORKSHEET_DATA th
    position: relative; z-index: 14; display: table;
    top: expression(document.getElementById("apexir_DATA_PANEL").scrollTop-3);
    table.apexir_WORKSHEET_DATA td
    border: solid 1px grey;
    td#Lock_Lateral
    background-color: #999999; position: relative; z-index: 15; display: table;
    left: expression(document.getElementById("apexir_DATA_PANEL").scrollLeft-3);
    th#Lock_Lateral_Vertical
    position: relative; z-index: 21; display: inline;
    top: expression(document.getElementById("apexir_DATA_PANEL").scrollTop-3);
    left: expression(document.getElementById("apexir_DATA_PANEL").scrollLeft-3);
    </style>
    <![endif]-->
    </code>
    ================================
    ackness

  • SharePoint 2010 List View with Group By is Not Sorting Correctly

    My organization has a list in SharePoint 2010 that is being used as a FAQ. The list contains the following columns:
    Question-  Single line of text 
    Answer-  Multiple lines of text 
    Priority-  Number 
    Priority is the importance of the question and is a unique integer number. Higher Priority questions are to be displayed at the top of the list.
    A view has been created to display the Question and Answer columns, grouped by Question, and sorted by Prioity. The problem is that the SharePoint is not sorting by priority. I have added display of Priority and embedded a screen capture showing the order
    going non sequentially from 1,005 to 1,024 to 1,015.
    Is this a known defect? Is there a workaround? Are there other options?
    Regards,
    Darian.

    Hi,
    Based on your description, I have done a test. I can reproduce your issue.
    Per my test, I come up with a conclusion.
    When we group by Question, the list view is be grouped. Then we sort by Priority, actually it is only sort the item within a group rather than the entire list.
    So the items inside of different groups out of order is normal.
    Best Regards,
    Lisa ChenForum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]
    Lisa Chen
    TechNet Community Support

  • Excel to PDF conversion fails to preserve freeze-frame heading functionality

    Using Excel ver 13.3.4 on MAC OS 10.6.8 and Acrobat Pro 10.1.3.
    I want to convert a 2-page Excel spreadsheet to a PDF.
    The spreadsheet has a repeating header row, which has "Freeze-Frame" applied so that you can see the header when you scroll to the next screenload. But when I open the PDF, the Freeze-Frame doesn't work. I can't find any posts about this problem. Can anyone help me out?

    Dear Pallavi,
    Very useful post!
    I am looking for similar accelerators for
    Software Inventory Accelerator
    Hardware Inventory Accelerator
    Interfaces Inventory
    Customization Assessment Accelerator
    Sizing Tool
    Which helps us to come up with the relevant Bill of Matetials for every area mentioned above, and the ones which I dont know...
    Request help on such accelerators... Any clues?
    Any reply, help is highly appreciated.
    Regards
    Manish Madhav

  • Hide column header in a SharePoint list web part view ?

     Hi ALl,
    I have a links list in SharePoint 2010 and created a custom standard view to show links on home page.
    I want to hide header column for that particular created list web part view.I have used following css but it's hide all list
    and libraries header column.
    .ms-viewheadertr
      display: none;
    I want to hide specific list web part view column hide.
    Following is a snap in this i want to hide URL column in this view.
    Thanks,
    Balaji More

    You can add the following to an .xsl file and link to it in the "Miscellaneous" options when you edit the web part. By doing it this way, you can reuse the same style sheet over and over.
    This xsl basically overrides a couple of templates located in the "vwstyles.xsl" file, and removes the lines that add the header.
    (This code works in production, but I may not have replicated it properly in this forum, so please test first.)
    <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
    xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt"
    xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
    xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
    xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:SharePoint="Microsoft.SharePoint.WebControls"
    xmlns:ddwrt2="urn:frontpage:internal"
    xmlns:o="urn:schemas-microsoft-com:office:office">
    <xsl:include href="/_layouts/xsl/main.xsl"/>
    <xsl:include href="/_layouts/xsl/internal.xsl"/>
    <xsl:template match="View" mode="full">
    <xsl:apply-templates select="." mode="RenderView" />
    <xsl:apply-templates mode="footer" select="." />
    </xsl:template>
    <!-- Boxed and Boxed No Labels -->
    <!-- Issues Boxed and Boxed No Labels -->
    <xsl:template match="View[ViewStyle=/@ID='12' or ViewStyle=/@ID='13' or ViewStyle=/@ID='18' or ViewStyle=/@ID='19']" mode="full">
    <xsl:apply-templates select="." mode="RenderView" />
    </xsl:template>
    </xsl:stylesheet>
    DH

  • DataTable freeze column header

    Is there a way to freeze the column headers in a dataTable and scroll the rows so that as I use the scroller the headers are still visible?
    Thanks

    I really did figure it out. To get the datatable headers to freeze I created a custom component based on the datatable Tag and renderer classes from which I added a tbodyClass feature which sets the class in the tbody. In the tag class I added a tbodyClass property, a setter method and in the setProperties method I added
    if (tbodyClass != null) {
             if (isValueReference(tbodyClass)) {
              ValueBinding vb = Util.getValueBinding(tbodyClass);
              data.setValueBinding("tbodyClass", vb);
             else {
              data.getAttributes().put("tbodyClass", tbodyClass);
         }in the renderer class I added the following to the encodeChildren method between the lines writer.startElement("tbody", component); and writer.writeText("\n", null);
    String tbodyClass = (String) data.getAttributes().get("tbodyClass");
         and
    if (tbodyClass!=null){
             writer.writeAttribute("class", tbodyClass,
                          "tbodyClass");
         }then I created a tld with all the dataTable features and my new tbodyClass. Now I can set a feature like this
    <my:dataTable tbodyClass="scrollCssClass">  The style sheet for the scrollCssClass is as follows
    .scrollCssClass{
                       overflow-y: scroll;
                       overflow-x: hidden;
                       height: 350px;
                       width: 100;
    }the last change is to the faces-config file I added
    <render-kit>
          <renderer>
           <component-family>javax.faces.Data</component-family>
           <renderer-type>com.mycompany.dataTable</renderer-type>
           <renderer-class>com.mycompany.dataTableRenderer
              </renderer-class>
          </renderer>
      </render-kit>now the tbody that is created looks like <tbody class="scrollCssClass"> and the headers stays frozen.
    Hope this helps someone

  • SharePoint 2007 – 2013 migration List view webpart still shows 2010 look and feel even after visual upgrade run successfully in 2013.

    I migrated one site collection from 2007 to 2013 environment. I did Visual upgrade on both 2010 & 2013 successfully. We  have a strange issue with  Listviewwebpart with group by  functionality  still shows 2010 look and feel.  
    If I manually edit that  webpart and click ok the Listviewwebpart UI is showing the 2013 Look and feel.  However I can’t manually update all the webparts because there are nearly
    1500 subsites. I tried using console to update webpart but still not lucky
    Following is 2010 look and feel in sp 2013 site:
    expected look and feel should be as follows in sp 2013
    Thanks, Ram Ch

    Hi ramch011 ,
    For your issue, you can force through an upgrade to the new user interface by using Windows PowerShell:
    Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
    On the Start menu, click All Programs.
    Click Microsoft SharePoint 2010 Products.
    Click SharePoint 2010 Management Shell.
    At the Windows PowerShell command prompt, type the following command:
    $webapp = Get-SPWebApplication http://sitename
    foreach ($s in $webapp.sites)
    {$s.VisualUpgradeWebs() }
    For more information, see Get-SPWebApplication
    Reference:
    http://technet.microsoft.com/en-us/library/ff607998.aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • SharePoint 2010 list view web part not showing conditional formatting

    when I create conditional formatting in custom list is working fine & when it call through web part page (Data view web part) conditional formatting not showing. data is showing without conditional formatting.
    Dinuka M.

    When you use conditional formatting on some page it is writing inline CSS codes inside that page. thats why when you create a new page and add the same web part to that page, you must edit that page to apply conditional formatting to that
    web part.
    Best Regards, Mustafa Yılmaz MCITP, MCPD | www.mustafa-yilmaz.org | www.sharepointciyiz.biz
    When you say edit the page, do you mean edit it in SharePoint Designer, or in SharePoint itself. And is it a case of just editing, then saving the page and it will apply the conditional formatting, or is there a specific property you need to edit, and if so,
    what is it?

  • Script injection in SharePoint OOB List forms

    In SharePoint 2010 Out of box list forms Text Boxes,how can we prevent script injections?
    Thank you.

    Hello,
    >i am able to enter script into the title and description fields.
    I don't think you can stop this. You might also want to look at below MSDN for SP security.
    http://msdn.microsoft.com/en-us/library/ee696753.aspx
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for

  • Multiple files to idoc without bpm

    Hi I have gone through the previous threads and came to know that n:1 is not possible without bpm. But in case of idocs you can collect them in r/3 system itself using RSEOUT00 program. But if my scenario is like.......you have 10 files which are com

  • Adding text to a menu

    I added some text to a moving menu and the text is always there, it doesn't fade in like the buttons and title do, is there any way to make this do that as well?

  • HT2452 my imac is slow starting up

    WHEN I START MY IMAC UP IT GOES TO GREY SCREEN FOR 2 MINS THEN I GET APPLE LOGO AND IT STARTS UP BEFORE THIS HAPPEND IT WAS VERY QUICK I HAVE HAD THE IMAC 6 WEEKS IS IT A SOFTWARE PROBLEM I HAVE LION ON IT.

  • I have a Denon 1913 AVR and Apple TV. Doesn't work...

    The Denon won't pass through the video to the TV. I connected the HDMI directly to the TV and the optical out to the Denon, but the audio won't come through (apparently optical audio can only come from the TV). Any suggestions?

  • Query Group in Query Category different with Authorization's group number

    Hi All, In Authorization screen, it allowed to authorize up to 20 query group Whereas in Query Category window, it has only max 15 query group. Anyone has idea on why is the difference? Thanks in advance, MH