Thursday, July 28, 2011

ECMA script in SharePoint 2010

Hi,

ECMA Script is new in sharepoint 2010.First time when i got the task which should be done with ECMA script.But as i got 2 days,i couldn't do the task perfectly,my TL got bad impression.After some time there was requirement for my teammate in ECMA script,finally after googling i was able to do some POC's as below


Before writing the below code i have created a custom list with name 'Testlist',i have added another column with name 'Department' with type of single line of text

Below is the code to fetch the items from the list using ECMA script.For this added one CEWP on the page and through Edit HTML source of CEWP i have pasted below code




To debug this script actually i followed the below link,but as per opinion this method is not much affective as C# debugging,in some cases we couldn't get the value of the variable where we insert breakpoint
http://digsharepoint.blogspot.com/2011/04/how-to-know-all-methods-in-sharepoint.html

Below is the code to update List item using ECMA script

No comments:

Post a Comment