Wednesday, August 06, 2008

Sharepoint Menu Document Library Links



You may ask to your self, How do i get the Links to delete a list item?
Microsoft have a litle tutorial Using the URL Protocol that help you building you url and add the parameters to create a new List, or delete a ListItem like this example

Delete Listitem:
http://STSWeb1/_vti_bin/owssvr.dll?Cmd=Delete&ID=123&List=Teste&NextUsing=http://www.google.com

New List:
http://STSWeb1/_vti_bin/owssvr.dll?Cmd=NewList&ListTemplate=100&Title=Employees&LangID=1033

This values are direct, you problaby ask "how do i get dinamyc, directly from the Table", and i say yes is possible..., how?
Go to Core.js, this file is located:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033

This file in javascript is very important because already have a lot of method that return list name, id...
Example:

function Custom_AddDocLibMenuItems(m, ctx) ="Function to add Custom Menu"
ctx.HttpRoot = "Url Root";
currentItemID ="ItemID";
ctx.listName ="ListID";
ctx.imagesPath="Path for images" ctx.imagesPath + 'Folder.GIF'
GetAttributeFromItemTable(itemTable, 'Url', 'ServerUrl')=Get File Path
CAMOpt(m,"Description",ActionOnClick,ImagePath)=Add Function to menu
CAMSep(m) ="Create a Separator on Menu"
return(true)= Default menu is off
return(false)= Default menu is on

This file help me creating my sharepoint upload Document webpart.
Post a Comment