To get all the items in a List you use
// Setup context & load web
context = new SP.ClientContext.get_current();
web = context.get_web();
context.load(web);
// Load task list
this.List = web.get_lists().getByTitle("YOUR_LIST_NAME);
context.load(this.List);
// Create a query to get all items
var camlQuery = SP.CamlQuery.createAllItemsQuery();
this.ListItems = this.View.getItems(camlQuery);
context.load(this.ListItems);
// Call the server and pass callback functions
context.executeQueryAsync(
Function.createDelegate(this, this.InitialLoad_OnSucccess),
Function.createDelegate(this, this.OnFailure));
How do you get all the items in a View?