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

174 Views Asked by At

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:

enter image description here

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

1

There are 1 best solutions below

0
On

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.