views:

36

answers:

1

Hi, I am trying to get the list from server through javascript using following

var request = new Sys.Net.WebRequest();
request.set_httpVerb("GET");
//request.set_orderby("Created");
request.set_url("http://sps2010:39153/_vti_bin/ListData.svc/MyList?$expand=CreatedBy");
request.get_headers()['Accept'] = 'application/json';
request.add_completed(handleRequestComplete);
request.invoke();

Now I want to order above with one of the column, I can order it without using expand, i.e

request.set_url("http://sps2010:39153/_vti_bin/ListData.svc/MyList?$orderby=Created desc");

But I can't combine expand and orderby ... strange ... any ideas?

A: 

I found the answer to my own question.... here is how you combine expand and orderby

http://sps2010:39153/_vti_bin/ListData.svc/MyList?$expand=CreatedBy&$orderby=Created

easy really once you know how ... :) hope it will save you guys some time ...

alittlebitofday