標籤:style blog http color java 使用 io for ar
?
使用SPService的SPCascadeDropdowns來實現。
可以參考http://www.cnblogs.com/Sunmoonfire/archive/2010/09/11/1823678.html來實施。
- 下載SPService js包,從http://spservices.codeplex.com/擷取
- 下載jQuery js包,從www.jquery.com擷取,推薦1.10以上版本
- 將SPService和jQuery包上傳至SharePoint網站的文件庫中,比如網站資產庫
- 先驗證上傳的js包可用,參考http://sympmarc.com/2011/07/08/adding-jqueryspservices-to-a-sharepoint-page-step-one-always/
- 建立Country和State網站欄,並添加到需使用級聯的列表或文件庫中
- 開啟列表的NewForm.aspx頁面,可以直接在IE中開啟,如http://SPServer/List/NewForm.aspx
- 點擊網站操作->編輯頁面,添加一個內容編輯器WebPart,點擊內容編輯器的內容框後,選擇Ribbon上的HTML->編輯HTML原始碼
- 建立需級聯的列表,比如Country、State,其中State列表中包含Country的Lookup欄
- 在彈出的對話方塊中輸入如下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>
- 建立一個項目,現在應該可以在原生Form中實現級聯清單項目了。
SP2010通過jQuery實現級聯列表