3/17/2013

Freezing the Title Row of a SharePoint 2010 List or Library

 

SharePoint 2010 lists and libraries do not have scrollbars. The pages do, but when you scroll down a long list you will find that the column headings scroll off of the top of the page. The little project below is a quick and dirty little project to add scrollbars to a list and lock the column titles in place.

Before scrolling: (click the image for a larger version)

image

After scrolling (headings have scrolled off of the top):

image

After the fix below:

image

Bonus! Notice that not only are the column headings always displayed, but so is the "Add new item link" at the bottom!

Before you continue…

  • This is a work in progress and presented as starting point for your own experiments!
  • This has only been tested in SharePoint 2010
  • It can be made to work with 2013, but there's a few extra steps that I'll need to document
  • This works with View pages… it needs more work before being used with views displayed in web parts
  • There's some excess white space at the top of the list.
  • This does not work with the following view options (and probably a few more):
    • Grouping
    • The Content Editor Web Part as adding it breaks the default view selection behavior (You must use SharePoint Designer)
  • There is a flaw with FireFox and possibly other browsers:
    • The heading row may be listed twice

 

If you are OK with the above, then give it a try!

Steps:

  1. If you don't want to customize the default "All Items" (allitems.aspx) view then create a new Standard view
  2. You may want to customize your view and set the item limit to a number larger than the default of 30. Do not exceed 5000. (A SharePoint restriction)
  3. Open the site in SharePoint Designer
  4. Click Lists and Libraries and click your list
  5. Click the view you want to customize
  6. Click the Advanced Mode button in the Home tab of the ribbon
  7. In the Code pane scroll down and find "</WebPartPages:WebPartZone>" – you will add your code between that tag and the "</asp:Content>" tag
  8. Copy the code from below and paste between the two tags listed above
  9. Edit the following line and replace Bikes with the name of your list
        var SummaryName = "Bikes "
     
    Note: View your list page, use the browser's View Source feature and search for "summary=". Copy what follows including any spaces. If your list is named Bikes and has no description defined then you will find "Bikes ".  (note the space at the end) If your list has a description then you may find something like "Bikes This is a list of bikes for sale."  (note the exact use of spaces and the possible presence of a period or other punctuation)

    Another example: The default Shared Documents library has this summary name: "Shared Documents Share a document with the team by adding it to this document library."
     
  10. In the <style> section adjust the height of the scrolling area of your list – you may need some trail and error here
    #TTNlist
    {
      height:200px;
      overflow-y:scroll !important;
      overflow-x     :auto
    }
  11. Save your changes and test your view

If it does not work:

Check your SummaryName! It has to be exactly what's found in the view page's HTML.

Try a delayed run of the script…

  Comment out this line by adding two slashes at the beginning:
    //or call the function immediately
    TTNListScroll();         <—this line

  And uncomment the spBodyOnLoadFunctionNames line:
    // update the list after the page has loaded
    //_spBodyOnLoadFunctionNames.push("TTNListScroll");

 

 

The code:

<script>
 
function TTNListScroll()
{
  // Scrolling list code from TechTrainingNotes.blogspot.com
  // Edit the next line with your list's summary name
  var SummaryName = "Bikes 2 ";
 
  var TTNmyTable;    
  var TTNListDiv = document.createElement('div'); 
  var TTNHeadingDiv = document.createElement('div');
 
  var tables = document.getElementsByTagName("TABLE");
  for (var i=0;i<tables.length;i++)
  {
    if ( tables[i].summary == SummaryName )
    {
      TTNmyTable = tables[i];
      break;
    }
  }
 
  if(TTNmyTable == undefined)
  {  
    //
    // Table not found!
    // you may want to comment out the next line after testing
       alert("table '" + SummaryName + "' not found");
    //
    return;
  }
 
  // make a copy of the table for the heading area
  TTNHeadingDiv.appendChild(TTNmyTable.cloneNode(true)); 
  TTNHeadingDiv.id="TTNheading";
  TTNListDiv.appendChild(TTNmyTable.cloneNode(true)); 
  TTNListDiv.id="TTNlist";
  TTNListDiv.width="100%";
 
  // udpate the page
  var TTNnode = TTNmyTable.parentNode
  TTNnode.replaceChild(TTNHeadingDiv, TTNmyTable);
  TTNnode.appendChild(TTNListDiv);
 
  // hide the heading row of the main list
  TTNListDiv.childNodes[0].rows[0].style.visibility='hidden';
  
  // make the DIV for the heading the same width as the main list
  TTNHeadingDiv.childNodes[0].style.width = TTNListDiv.childNodes[0].offsetWidth 
}
 
// update the list after the page has loaded
//_spBodyOnLoadFunctionNames.push("TTNListScroll"); 
 
//or call the function immediately
TTNListScroll();
 
</script>
 
<style type="text/css">
 
#TTNheading
{
  height:28px;
  overflow:hidden;
}
 
#TTNlist
{
  height:200px;
  overflow-y:scroll !important;
  overflow-x     :auto
}
 
</style>

 

 

.

3/07/2013

Reminder! Cincinnati and Dayton SPUG March Meetings


Cincinnati SharePoint User Group
Next meeting: TONIGHT
3/7/2013 - 6:30 PM (Pizza and networking at 6:00 PM!)  (details below)

 

Dayton SPUG
Next Meeting - Tuesday, March 12, 2013 starts at 6:00 p.m.
(details below)


Update!

If we get at least 30 people to the March meeting MAX Technical Training will donate a free pass to SharePoint Cincy 2013! And... everyone will get a MAX T-shirt. And... I think I've still got a radio controlled helicopter around... And there's still a book or two...

So... drag your friends and coworkers to the meeting! (And please click the I'm attending button on the TechLife Cincinnati Site so we know how much food to order!)


Cincinnati SharePoint User Group
Next meeting: 3/7/2013

Tony Maddin will present:

SharePoint 2013 Real Estate – Do you buy, rent, or both?

Tony Maddin will be presenting on the SharePoint 2013 hosting models for on-premise, Office365, and the Hybrid (both on-premise and Office365 tied together) to share insight on features should be reviewed in order to help an organization to choose the right model that fits.

Past Meetings...


Dayton SPUG: @DAYSPUG

Next Meeting - Tuesday, March 12, 2013 starts at 6:00 p.m.
Event: DAYSPUG Annual Social Gathering. A great way to celebrate the upcoming SharePoint 2013 launch, SharePoint 2010 Service Pack 2, Office365, spring season, and surviving the Mayan calendar prediction.

PLEASE RSVP HERE

Location: Fox and the Hound. Beavercreek, Ohio
Event Details: DAYSPUG will be hosting a social gathering this month in lieu of our normal monthly meeting. Appetizers and soft drinks will be provided. All draft beers are $2 all night! Come on out, meet some new SharePoint friends, and support the community! Applied Information Sciences will be our gracious sponsor for the night.
Time: 6:00 p.m. to 8:00 p.m.


Interested in HTML5 and CSS3?

The user group gets points if you sign up! (Points = free books!)

Free HTML 5 online training here:

HTML5 training


And don't forget… SharePoint Cincy 2013 is coming soon! April 19th

Third Annual SharePoint Cincy Event!

http://www.sharepointcincy.com/

Choose From Multiple Tracks:

This conference promises to have something for every level of your organization and every IT professional who has an interest in SharePoint.

  • Driving Business Value with SharePoint
  • Application Development in SharePoint
  • SharePoint Implementation and Administration
  • Business Intelligence and Data Management
  • Site Owners, Content Managers & Power Users

Who should attend?

  • Application/Software Developers
  • Information Architects
  • SharePoint Administrators
  • IT Business Leaders
  • Knowledge Workers
  • IT Professionals

3/01/2013

New SharePoint 2013 content in TechNet

 

Microsoft released a lot of new content on SharePoint 2013 in TechNet in February. After a quick count, it looks like around 40 new articles and number of updated articles. Lots of good stuff here…

Here's the link to a list of the articles:  http://technet.microsoft.com/en-us/library/cc262043.aspx

A little light reading for the weekend… Smile

.

2/28/2013

SharePoint 2013 First Looks for ITPros and Developers–Classroom and Webinar

 

I will be presenting two FREE SharePoint 2013 First Look clinics this March 8th at MAX Technical Training. You can attend these sessions in person at MAX's Cincinnati area Mason, Ohio training center or remotely using any PC.

Just for fun, when registering add a note that "Mike sent me!" (Or maybe… "Attending in spite of Mike")

 

MS-40027 First Look: What's New for Developers in Microsoft SharePoint 2013

More info here: http://www.maxtrain.com/Classes/ClassInfo.aspx?Id=43826

This 1/2 day instructor-led developer first-look course provides an overview of the new features, functional areas, product enhancements, and application models in SharePoint 13.

At Course Completion

  • Provide an overview of the new features, functional areas, and product enhancements in SharePoint 2013.
  • Summarize the key features of the SharePoint 2013 application development platform and describe the key features of Marketplaces.
  • Explain what a SharePoint-Hosted app is, and describe how to build a SharePoint-Hosted app.
  • Explain what a Cloud-Hosted app is, and describe how to build a Cloud-Hosted app.
  • Describe how developers extend Office Application user interfaces by creating Apps for Office and publishing them in different catalogs.
  • Describe how to create and code a simple App for Office that interacts with document content.
  • Describe improvements in Manage Metadata Services, Enterprise Content Management and Web Content Management in SharePoint 2013.
  • Describe the new social networking functionality available to SharePoint 2013 App developers.
  • Describe how the new capabilities of the SharePoint Search engine can be used in SharePoint Apps.
  • Describe how to query the index from a SharePoint-Hosted app using CSOM.

 

MS-40028 First Look Clinic: What’s New for IT Professionals in Microsoft SharePoint Server 2013

More info here: http://www.maxtrain.com/Classes/ClassInfo.aspx?Id=44107

This 1/2 day instructor-led first-look clinic explains the new and improved product features as applicable to IT Professionals and how to install, deploy, manage, and administer SharePoint Server 2013. It also provides information on how to integrate SharePoint Server 2013 with key applications and how to maintain and troubleshoot SharePoint Server 2013.

At course completion:

  • Identify the major new features in SharePoint 2013 for IT Pros
  • Discuss the major architectural changes in SharePoint 2013
  • Describe the major changes to the BCS and the search service
  • Describe the new BI and composites features in SharePoint 2013
  • Describe the new content management and compliance features
  • Identify the new features for social computing and mobile users

.

And if you can't get enough of SharePoint 2013…

Tony Maddin will present the night before, March 7th, at the Cincinnati SharePoint User Group on:

SharePoint 2013 Real Estate – Do you buy, rent, or both?

Tony Maddin will be presenting on the SharePoint 2013 hosting models for on-premise, Office365, and the Hybrid (both on-premise and Office365 tied together) to share insight on features should be reviewed in order to help an organization to choose the right model that fits.

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.