简体   繁体   中英

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. This works to get all the SP list items.

  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. 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"]]); return await sp.web.lists.getByTitle(spListName).renderListDataAsStream({ ViewXml: xml, Paging: paging,
    },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. 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

React table using server filtering and pagination (still in slow development) -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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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