首先需要在我们的Sharepoint网站上创建一个名为product的list,如下图:
一、添加List Item--新增一个product(Add Product)
<
input
id
="btnNewProduct"
type
="button"
value
="Add Product"
onclick
='addProduct("AsusLapTop4",
"Asus AX44H4 Laptop2", "2011-12-16", "46", "Computer")'
/>
按 Ctrl+C 复制代码
按 Ctrl+C 复制代码
二、删除List Item--删除一个product(Delete Product)
<
input
id
="btnDeleteProduct"
type
="button"
value
="Delete Product"
onclick
='deleteProduct(1)'
/>
按 Ctrl+C 复制代码
按 Ctrl+C 复制代码
三、检索List Item--根据ProductID来获取一个product(Get Item By ProductID)
<
input
id
="btnGetItemByID"
type
="button"
value
="Get Item By ProductID"
onclick
='getProductById(2)'
/>
按 Ctrl+C 复制代码
按 Ctrl+C 复制代码
四、查找list Item--在product列表中查找product(search Item By ProductTitle)
<
input
id
="btnSearchItem"
type
="button"
value
="Search Item By ProductTitle"
onclick
='getProducts("AsusLapTop4")'
/>
按 Ctrl+C 复制代码
按 Ctrl+C 复制代码
五、更新List Item--更新product(Update Items for a List)
<
input
id
="btnUpdateItem"
type
="button"
value
="Update a Product"
onclick
='updateProduct(3,
"AsusLapTopNew3", "Asus Lap Top New Desc3", "2011-12-18", "100", "Computer") '
/>
按 Ctrl+C 复制代码
按 Ctrl+C 复制代码