Tag Info

Hot answers tagged


You could sort list items using array.sort function: function getListItems(listTitle,success,error) { var ctx = SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getByTitle(listTitle); var items = list.getItems(SP.CamlQuery.createAllItemsQuery()); ctx.load(items); ctx.executeQueryAsync(function() { success(items); ...


You can use the Order By in CAML: <OrderBy> <FieldRef Name = "ID" Ascending = "TRUE"/> </OrderBy> <Where> ... </Where>


Your code looks like you are using server object model using c#. I have faced issues using CAML queries. My queries were not able to pull data, But after removing <Query></Query> tag I was able to solve the problem. So based on my past experience I can propose you following improvements and try the below code. Query query = new SPQuery(); ...

Only top voted, non community-wiki answers of a minimum length are eligible