zoukankan      html  css  js  c++  java
  • SharePoint Tips and Tricks Ribbon,People Editor

    Ribbon

       

    How To在非"Application Page"页面上添加Ribbon Tool Bar?

       

    需要在Head部分添加Ribbon控件

       

    <head id="Head1" runat="server">

    <SharePoint:SPRibbon ID="SPRibbon2" runat="server" PlaceholderElementId="RibbonContainer" CssFile="">

    <SharePoint:SPRibbonPeripheralContent runat="server" Location="TabRowRight" ID="SPRibbonPeripheralContent1" CssClass="s4-trc-container s4-notdlg" ></SharePoint:SPRibbonPeripheralContent>

    </SharePoint:SPRibbon>

       

    How To 在"Application Page"上添加Contextual Tab?

       

    1 ContextualGroup添加Command属性

    <ContextualGroup Color="Magenta" Command="CustomContextualTab.EnableContextualGroup" Id="Ribbon.CustomContextualTabGroup"

    Title="Custom Contextual Tab Group"

    Sequence="502"

    ContextualGroupId="CustomContextualTabGroup">

       

    2 在您自定义的PageComponent中处理ContextualGroup相关的Command.

    例如上文中的ContextualGroup,您需要在getGlobalCommands方法返回的命令数组中,包含"CustomContextualTab.EnableContextualGroup",并在canHandleCommand返回True.

       

    People Editor

       

    How To JavaScriptPeopleEditor控件赋值?

       

    function setPeoplePicker(pickerid, value) {

    var field = $("#" + pickerid);

    if (field.find('.ms-inputuserfield:visible').length > 0) {

    // IE

    var userlist = field.find('.ms-inputuserfield').html();

    field.find('.ms-inputuserfield').html(userlist+";"+value);

    field.find('img:first').click();

    } else {

    // FF

    var userlist = field.find("textarea:first").val();

    field.find("textarea:first").val(userlist + ";" + value);

    }

    }

    $(document).ready(function () {

    setPeoplePicker("<%=MyPeopleEditor.ClientID%>", "CustomValue");

  • 相关阅读:
    磁盘原理总结
    Algorithm:多维数组和矩阵
    Algorithm:字典序最小问题
    Algorithm:递归思想及实例分析
    Algorithm:贪心策略之区间覆盖问题
    Algorithm:贪心策略之区间选点问题
    Algorithm:位运算的这些小技巧你知道吗?
    面试题
    操作系统
    数据结构:B树和B+树的插入、删除图文详解
  • 原文地址:https://www.cnblogs.com/osamede/p/2185262.html
Copyright © 2011-2022 走看看