28 August 2011

SharePoint: Remove link from list view title

Links can't be easily removed from list view titles (or web part titles, for that matter). That's where jQuery comes in handy:
$(document).ready(function () {

// Remove the link from the web part title and set its cursor to normal.
$('.ms-WPTitle > a').contents().unwrap().css('cursor','default');
$('.ms-WPTitle').css('cursor','default');
});
This is thanks to a tip from this post on StackOverflow.com. Note also that the code sets the cursor to default (instead of "hand").

No comments: