SP2010通過jQuery實現級聯列表

來源:互聯網
上載者:User

標籤:style   blog   http   color   java   使用   io   for   ar   

?

使用SPService的SPCascadeDropdowns來實現。

可以參考http://www.cnblogs.com/Sunmoonfire/archive/2010/09/11/1823678.html來實施。

  1. 下載SPService js包,從http://spservices.codeplex.com/擷取
  2. 下載jQuery js包,從www.jquery.com擷取,推薦1.10以上版本
  3. 將SPService和jQuery包上傳至SharePoint網站的文件庫中,比如網站資產庫
  4. 先驗證上傳的js包可用,參考http://sympmarc.com/2011/07/08/adding-jqueryspservices-to-a-sharepoint-page-step-one-always/
  5. 建立Country和State網站欄,並添加到需使用級聯的列表或文件庫中
  6. 開啟列表的NewForm.aspx頁面,可以直接在IE中開啟,如http://SPServer/List/NewForm.aspx
  7. 點擊網站操作->編輯頁面,添加一個內容編輯器WebPart,點擊內容編輯器的內容框後,選擇Ribbon上的HTML->編輯HTML原始碼
  8. 建立需級聯的列表,比如Country、State,其中State列表中包含Country的Lookup欄

  1. 在彈出的對話方塊中輸入如下js指令碼

<script language="javascript" src="/SiteAssets/jquery-1.10.2.js" type="text/javascript"></script>

<script language="javascript" src="/SiteAssets/jquery.SPServices-2014.01.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

$(document).ready(function()

{

$().SPServices.SPCascadeDropdowns(

{

relationshipWebURL: "/",

relationshipList: "State",

relationshipListParentColumn: "Country",

relationshipListChildColumn: "Title",

parentColumn: "Country",

childColumn: "State",

debug: true

});

});</script>

  1. 建立一個項目,現在應該可以在原生Form中實現級聯清單項目了。

SP2010通過jQuery實現級聯列表

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.