2016-11-28 55 views

回答

0

如果你想打開整個頁面的形式,該鏈接應該是這樣的:

<a href="<weburl>/Lists/<calendarlist>/NewForm.aspx">Add New Event</a>

要在模態對話框打開:

function openDialog() { 
 

 
    var url = "<weburl>/Lists/<calendarlist>/NewForm.aspx"; 
 
    var options = { 
 
     title: "Add New Event", 
 
     width: 400, 
 
     height: 600, 
 
     url: url 
 
    }; 
 

 
    SP.UI.ModalDialog.showModalDialog(options); 
 
}
<a href="#" onclick="openDialog()">Add New Event</a>

覆蓋<weburl>與網絡相對URL和<calendarlist>與列表的相對URL(大部分時間列表名稱) 例子:https://mysiteurl/Lists/Calendar/NewForm.aspx

0
  1. 在網站頁面中,單擊編輯頁面和點擊添加Web部件。
  2. 從類別中的應用程序部分選擇您的日曆列表。
  3. 一旦您的日曆在您的網站頁面,再次單擊添加Web部件。
  4. 從媒體和內容部分選擇內容編輯器Web部件。
  5. Inside Content Editor webpart點擊「點擊此處添加新內容」
  6. 在功能區中,單擊「編輯源代碼」。 [此處輸入圖像的描述] [1]
  7. 鍵入或粘貼以下代碼:

<a href="webUrl/Lists/Calendar/NewForm.aspx">Add New Event</a>

  • 最後點擊保存頁面上。
  • 相關問題