I have requirement which is
- Retrieve List Items in a List(list created through OOB)
- Display those list items on the sharepoint site by binding to repeator control
- Using javascript and client object model.
Steps I have done
- Created a new SharePoint Project
- Added a new Application Page to the project
- Wrote the below code
<script type="text/javascript">
var ListItem;
function GetListItems(listname, listItemId)
{
var SPContext = new SP.ClientContext.get_current();
var web=SPContext.get_web();
var List=web.get_lists().getByTitle("Menu Items");
ListItem = list.getItemById(listItemId);
SPContext.load(ListItem,"Menu_Title","Menu_Image","Menu_Description");
SPContext.executeQueryAsync(GetListItemById);
}
function GetListItemById_Successor(sender, args)
{
var id = ListItem.get_id();
var title = ListItem.get_item("Menu_Title");
var Image = ListItem.get_item("Menu_Image");
var Description = ListItem.get_item("Menu_Description");
alert("Updated List Item: \n Id: " + id + " \n Title: " + title+ "\n Image:" +Image+ "\n Description:" +Description );
}
function GetListItemById_Fail(sender, args)
{
alert("GetListItemById Failed. \n" + args.get_message() + "\n" + args.get_stackTrace());
}
</script>
My code deploys successfully with no errors but not able to see... Please help me on this,I am not getting an intellisense menu for the client object model classes and objects.
Is there a step by step process tutorial or suggestions are highly appreciated
Retreving items in a SharePoint list using Client Object Model in javascript and bind that to repeator control