SharePoint2013APP开发问题总结

1、问题:'NotifyScriptLoadedAndExecuteWaitingJobs' is undefinedjavascript

描述:使用JavaScript对象模型调用搜索服务,在运行sp.search.js抛出异常:0x800a1391 - JavaScript 运行时错误: 'NotifyScriptLoadedAndExecuteWaitingJobs' 未定义java

解决方法:在页面引入init.js     <script type="text/javascript" src="/_layouts/15/init.js"></script>编程

NotifyScriptLoadedAndExecuteWaitingJobs 就是在init.js中定义的,还有SP.SOD方法也是,若是出现“SP.SOD未定义”这种错误,一样引入init.js便可app

2、问题:添加自定义CustomAction,点击后如何弹出模态窗体框架

 <CustomAction Id="e5535f8e-b06c-4cd4-bcb2-ae51ae1fa2ec.FixDocRCA"
                RegistrationType="List"
                RegistrationId="101"
                Location="CommandUI.Ribbon"
                Sequence="10001"
                Title="自定义按钮"ide

<!--表示在一个新窗体中打开-->           spa

 HostWebDialog="TRUE"
    HostWebDialogHeight="420"
    HostWebDialogWidth="510" >server

<CommandUIExtension>对象

    <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Documents.Manage.Controls._children">
          <Button Id="Ribbon.Domuments.Manage.FixDocRCAButton"
                  Alt="自定义按钮"
                  Sequence="100"
                  Command="Invoke_FixDocRCAButtonRequest"
                  LabelText="自定义按钮"
                  TemplateAlias="o1"
                  Image32by32="_layouts/15/p_w_picpaths/placeholder32x32.png"
                  Image16by16="_layouts/15/p_w_picpaths/placeholder16x16.png" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="Invoke_FixDocRCAButtonRequest"ip

<!--跳转到Post.aspx,在SharePoint2013的CommandAction中不支持JavaScript方法-->
                          CommandAction="~appWebUrl/Pages/Post.aspx?{StandardTokens}&amp;SPListItemId={ItemId}&amp;SPListId={ListId}}"

<!--某条文档记录选中该按钮才会启用-->            EnabledScript="javascript:SP.ListOperation.Selection.getSelectedItems().length == 1"

/>

      </CommandUIHandlers>
    </CommandUIExtension >
  </CustomAction>

 另外在跳转页面Post.aspx的PlaceHolderAdditionalPageHead还应该引入

 <WebPartPages:AllowFraming ID="AllowFraming1" runat="server" />

表示容许将该页面做为一个框架显示

 

3、问题:如何编程设置某个术语集的“提交策略”为“开放式”(用户能够在文本框中直接输入术语集中不存在的术语A,A能自动插入到术语集中)

参考连接:http://www.c-sharpcorner.com/Blogs/10855/how-to-set-the-submission-policy-for-the-term-set-using-clie.aspx

相关文章
相关标签/搜索