简体   繁体   English

ADO.NET数据服务结合Orderby并在REST上扩展

[英]ADO.NET data services Combining Orderby and expand on REST

I am trying to get the list from server through javascript using following 我正在尝试使用以下方法通过javascript从服务器获取列表

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, ie 现在,我想用一列中的一个进行订购,我可以不使用expand进行订购,即

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? 但是我不能将expand和orderby结合在一起……奇怪……有什么想法吗?

I found the answer to my own question.... here is how you combine expand and orderby 我找到了我自己的问题的答案。...这是如何将expand和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 ... 一旦知道如何就很容易... :)希望它可以节省你们一些时间...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM