码迷,mamicode.com
首页 > 移动开发 > 详细

SharePoint2013APP开发问题总结

时间:2014-07-29 15:36:10      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:sharepoint2013   app   

一、问题:‘NotifyScriptLoadedAndExecuteWaitingJobs‘ is undefined

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

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

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

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

 

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

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

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

<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/images/placeholder32x32.png"
                  Image16by16="_layouts/15/images/placeholder16x16.png" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="Invoke_FixDocRCAButtonRequest"

<!--跳转到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" />

表示允许将该页面作为一个框架显示

 

SharePoint2013APP开发问题总结,布布扣,bubuko.com

SharePoint2013APP开发问题总结

标签:sharepoint2013   app   

原文地址:http://greensky.blog.51cto.com/3347654/1531875

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!