Sharepoint ECMAScript对象模型系列 使用ECMA操作列表项对象(listitem)

首先需要在我们的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 复制代码

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值