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

相關文章
相關標籤/搜索