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 25, 2009
Tuesday, August 18, 2009
ListTemplateId for Event List
- GenericList 100
- DocumentLibrary 101
- Survey 102
- Links 103
- Announcements 104
- Contacts 105
- Events 106
- Tasks 107
- DiscussionBoard 108
- 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
Subscribe to:
Posts (Atom)