简体   繁体   中英

Code change for Spfx React-jump-to-folder (link in des) to change sorting order of Doc library folders

New to spfx.. I've built and applied react-jump-to-folder( https://github.com/pnp/sp-dev-fx-extensions/tree/master/samples/react-jump-to-folder ).

Doc Library view is sorted by custom column "Folder order" which I added with values (1, 2, 3, 4...) for sorting purposes. SP by default does not sort as desired. Using the extension the folders again appear as follows:

在此处输入图像描述

Where to make changes in base code as to sort the folders by the column "Folder order" ?

The FolderExplorer component used in this example does not support custom folder ordering. If you really want to achieve that, there are ways, though. I can think of the following options:

Option 1: you modify the FolderExplorer control to support custom sorting. It's open source , so you can do that. You cna fork the sp-dev-fx-controls-react package and create your own build of it.

Option 2: you could try "hacking" into the state of the FolderExplorer component, and every time the component's folders are updated you re-sort them and set a new state in the component, with proper sorting.

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