Tuesday, August 25, 2009

Change SharePoint 'Document library/List' Column width

Sometimes we need to change default column width of document library/list.To change sharepoint document library/list column we need to add a content editor webpart on that perticular page and need to write below code as javascript script. (use below code within javascript tag)

_spBodyOnLoadFunctionNames.push("ModifiyCommentWidth");
function ModifiyCommentWidth() {
for (var i = 0, l = document.getElementsByTagName("TH").length; i < l; i++) { var thisTH = document.getElementsByTagName("TH")[i]; if (thisTH.className == 'ms-vh2-nograd') { if (thisTH.innerText == 'Comments') {
thisTH.style.width = "300px";
}
}


Please ensure tag name before use this line of code because this is not same for all. This is working in my case but you need to update tag names accordingly.

Tuesday, August 18, 2009

ListTemplateId for Event List

  1. GenericList 100
  2. DocumentLibrary 101
  3. Survey 102
  4. Links 103
  5. Announcements 104
  6. Contacts 105
  7. Events 106
  8. Tasks 107
  9. DiscussionBoard 108
  10. PictureLibrary 109

Events = Calendar = 106

Workflow Status Fields Named/Value Pairs


Not Started 0
Failed on Start 1
In Progress 2
Error Occurred 3
Canceled 4
Completed 5
Failed on Start (retrying) 6
Error Occurred (retrying) 7
Canceled 15
Approved 16
Rejected 17