[SharePoint 2010] 自定义字段类型开发(二)
2013-11-25 15:01
295 查看
在SharePoint 2010中实现View Action Button效果。
http://www.sharepointblogs.be/blogs/vandest/archive/2008/06/20/view-action-button.aspx
1. 创建自定义字段类ViewActionButton 继承自 SPTextField
fldtypes_ViewActionButton.xsl
5. 下载
ViewActionButton.zip
http://www.sharepointblogs.be/blogs/vandest/archive/2008/06/20/view-action-button.aspx
1. 创建自定义字段类ViewActionButton 继承自 SPTextField
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"> <xsl:template match ="FieldRef[@FieldType='ViewActionButton']" mode="Text_body"> <xsl:param name="thisNode" select="."/> <xsl:variable name="ActionURL" select="current()/@ActionURL" /> <xsl:variable name="Format" select="current()/@Format" /> <xsl:variable name="CssClass" select="current()/@CssClass" /> <xsl:choose> <xsl:when test="$Format='Button'"> <input type="button"> <xsl:attribute name="class"> <xsl:value-of select="$CssClass"/> </xsl:attribute> <xsl:attribute name="value"> <xsl:value-of select="$thisNode/@Name"/> </xsl:attribute> <xsl:attribute name="onclick"> javascript:window.location=STSPageUrlValidation('$ActionURL?ID=$thisNode/@ID&List=$List'); </xsl:attribute> </input> </xsl:when> <xsl:otherwise> <a target="_blank"> <xsl:attribute name="class"> <xsl:value-of select="$CssClass"/> </xsl:attribute> <xsl:attribute name="href"> <xsl:value-of select="$ActionURL" />?ID=<xsl:value-of select="$thisNode/@ID" />&List=<xsl:value-of select="$List" /> </xsl:attribute> <xsl:value-of select="current()/@DisplayName"/> </a> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>
fldtypes_ViewActionButton.xsl
5. 下载
ViewActionButton.zip
相关文章推荐
- SharePoint 2010 自定义字段"大写金额"开发
- 如何在SharePoint 2010中创建自定义字段类型
- SharePoint 2010 自定义字段开发
- 在SharePoint 2010中创建自定义字段类型
- SharePoint 2010 自定义 字段 类型--------三级互联(省县市)
- sharepoint 2013 开发自定义字段类型说明
- SharePoint 2010 自定义字段开发
- SharePoint 2010 自定义 字段 类型--------省市区联动
- Sharepoint自定义字段开发(Custom Field) - Inside Microsoft Sharepoint 2010 读书笔记
- SharePoint 2010 自定义 字段 类型--------省市区联动
- 开发自定义字段类型 sharepoint
- 开发自定义字段类型 sharepoint
- 转载:SharePoint 2010 自定义 字段 类型--------省市区联动
- sharepoint 2010 自定义字段开发(1) 创建一个简单的列表自定义字段
- SharePoint 2010 自定义 字段 类型--------省市区联动
- msdn创建自定义 SharePoint 2010 字段类型
- SharePoint 2010 自定义字段开发
- 请问SharePoint高手,怎样开发一个类似查阅项的字段类型?(无奈求助,请保留一两天)
- 通过自定义字段类型实现SharePoint列表的父子关系
- sharepoint 2010 在自定义列表的字段上增加功能菜单