用于按层次结构顺序检索 ListItems 的 CAML 查询
我想知道是否可以对从 SharePoint 返回的列表项进行排序(使用客户端对象 API),以便它们按层次结构排序,而不是按创建的顺序排序。
这是保持文件夹结构完整的需要。例如,如果这是一个结构:
folder001
-folder001_sub001
--item001
--item002
-folder002_sub002
--folder002_sub002_sub001
---item003
--item004
-item005
将以相同的顺序或至少以这种方式返回(首先是项目,然后是文件夹):
folder001
-item005
-folder001_sub001
--item001
--item002
-folder002_sub002
--item004
--folder002_sub002_sub001
---item003
这可以通过 CAML 查询实现吗?默认情况下按创建顺序返回事物(按列表内的索引号)
提前谢谢您!
I was wondering if it possible to order listitems coming back from SharePoint (using Client Object API) so that they are ordered hierarchly, and not in the order they were created.
This is need to keep the folder structure intact. So for example if this was a structure:
folder001
-folder001_sub001
--item001
--item002
-folder002_sub002
--folder002_sub002_sub001
---item003
--item004
-item005
would be returned in the same order or at least this way (items first, then folders):
folder001
-item005
-folder001_sub001
--item001
--item002
-folder002_sub002
--item004
--folder002_sub002_sub001
---item003
Is this possible with CAML query? Default is to return things in order they were created (by index number inside the list)
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下,我宁愿使用客户端对象模型而不是 caml。你可以做这样的事情(未经测试!):
这个方法将以这种方式使用:
I would rather go with client object model instead of caml in this scenario. You could do something like this (untested!):
This method would be used in this way: