最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to open New List Item Form in modal dialog in a SharePoint 2010 page from different site collection - Stack Ove

programmeradmin0浏览0评论

I need to open a new list item form on hyperlink, or button click, in a Sharepoint 2010 page. The page and the list are in different site collections. I must do this from the Sharepoint Designer, or directly editing the page in a browser, Visual studio project is not possible/allowed...

Can this be done, and how?

I need to open a new list item form on hyperlink, or button click, in a Sharepoint 2010 page. The page and the list are in different site collections. I must do this from the Sharepoint Designer, or directly editing the page in a browser, Visual studio project is not possible/allowed...

Can this be done, and how?

Share Improve this question asked Jan 17, 2013 at 17:17 EedohEedoh 6,2889 gold badges42 silver badges63 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

P.S. Most safe way to address New form is to use ListForm.aspx page, as follows:

 /_layouts/listform.aspx?PageType=8&ListId={PUT-LIST-GUID-HERE}

(PageType value goes from PAGETYPE enumeration)

i think you should be work when use PAGE_NEWFORMDIALOG : New form for a file dialog box.Value=9 as describe on msdn. if New form is not open on model pop up than

Try this :

HyperLink

 <a href='javascript:;' onclick='Opendialog()'>New Item</a>

Opendialog is Javascript Function

   function Opendialog() {
       var options = SP.UI.$create_DialogOptions();
       options.resizable = 1;
       options.scroll = 1;
       options.url = SiteURLWhichExistList + "/_layouts/listform.aspx?PageType=8&ListId={PUT-LIST-GUID-HERE}";
       options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
       SP.UI.ModalDialog.showModalDialog(options);
   } 

Note : SiteURLWhichExistList pass your site collection url in where your list exist.

Hope it helps!!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论