简体   繁体   English

SharePoint SPFx - 无法使用 renderListDataAsStream 获取随机的分页、排序和过滤结果集

[英]SharePoint SPFx- Not able to use renderListDataAsStream to get random set of paged, sorted and filtered results

Because of list view threshold error, we planned to use the renderListDataAsStream method to query the SharePoint list.由于列表视图阈值错误,我们计划使用 renderListDataAsStream 方法查询 SharePoint 列表。 This works to get all the SP list items.这可以获取所有 SP 列表项。

  1. How can we get paged results?我们如何获得分页结果? Using for NextHRef?Paged=TRUE&p_RequestDate=20210326%2018%3a42%3a17&p_ID=243&PageFirstRow=101&View=00000000-0000-0000-0000-000000000000, we can get only the immediate next set of results.使用 NextHRef?Paged=TRUE&p_RequestDate=20210326%2018%3a42%3a17&p_ID=243&PageFirstRow=101&View=00000000-0000-0000-0000-000000000000,我们只能得到下一组结果。 Can't we get random results based on page selected?我们不能根据所选页面获得随机结果吗?
  2. To get filtered results based on search text, tried to pass a query string parameter- var queryParams= new Map([["InplaceSearchQuery","xxx"]]);要根据搜索文本获得过滤结果,请尝试传递查询字符串参数 - var queryParams= new Map([["InplaceSearchQuery","xxx"]]); return await sp.web.lists.getByTitle(spListName).renderListDataAsStream({ ViewXml: xml, Paging: paging,返回等待 sp.web.lists.getByTitle(spListName).renderListDataAsStream({ ViewXml: xml, Paging: paging,
    },null,queryParams).then((res) => { return res; },null,queryParams).then((res) => { return res;
    }); }); This does not work.这不起作用。 How do we get filtered set?我们如何获得过滤集? Do not want to store all the items in state and use that for filtering as it will be heavy.不想将所有项目存储在 state 中并将其用于过滤,因为它会很重。 Please recommend any solution options.请推荐任何解决方案选项。
  1. Pagination works only for next page.分页仅适用于下一页。
  2. I am using filtering (FilterField + FilterValue) - https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest我正在使用过滤(FilterField + FilterValue) - https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest

React table using server filtering and pagination (still in slow development) -https://github.com/Matej4386/Sharepoint/tree/master/m_sptablev2使用服务器过滤和分页的反应表(仍处于缓慢开发阶段) -https://github.com/Matej4386/Sharepoint/tree/master/m_sptablev2

I implemented a helper class for list item pagination using renderListDataAsStream, here is the package: https://www.npmjs.com/package/mgwdev-m365-helpers You can use SPListItemCamlPagedDataProvider class for list item pagination I implemented a helper class for list item pagination using renderListDataAsStream, here is the package: https://www.npmjs.com/package/mgwdev-m365-helpers You can use SPListItemCamlPagedDataProvider class for list item pagination

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

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