Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to implement some Move Up and Move Down hyperlinks in a list so that, for example, pressing move up moves the item one place up in the list.

I have tried giving the list an order column and sorting by it, but I am struggling to retrieve the list items using javascript, how I can I retrieve the item when all I know is it's order value?

share|improve this question
You could use a CAML query against the list, based on that the ordering field will contain unique values :) – Robert Lindgren Aug 5 at 9:43
This is the CAML query that I am currently using but I have no idea if it is returning an item at all: '<View><Query><Where>' + '<Eq>' + '<FieldRef Name=\'Order\'/>' + '<Value Type=\'Number\'>' + order + '</Value>' + '</Eq>' + '</Where></Query></View>' – B4Z Aug 5 at 9:46
Well it looks good, so probably it will! – Robert Lindgren Aug 5 at 9:49
So from that point I load the items matching the query and execute the query asynchronously, then I use an enumerator on the list items matching the query and use get_current() to get the first item, however, if I do alert(item) then it just says undefined. Is this correct? – B4Z Aug 5 at 10:17
How you iterate over list items with Client Object Model is really a different question – Robert Lindgren Aug 5 at 10:22

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.