You can use the get method to get the all the fields values from the Document library.
Code:
@autobind
private GetListItems(): void {
this.props.spHttpClient.get(`${this.props.siteUrl}/_api/web/lists/getbytitle('${this.props.listName}')/items?$select=fieldNames`,
SPHttpClient.configurations.v1,
{
headers: {
'Accept': 'application/json;odata=nometadata',
'odata-version': ''
}
})
.then((response: SPHttpClientResponse): Promise<{ value: IListItem[] }> => {
return response.json();
})
.then((response: { value: IListItem[] }): void => {
//Write your logic to form the json object from response
}, (error: any): void => {
this.setState({
status: 'Loading all items failed with error: ' + error,
});
});
}
Once you formed the json object, you can use the "material-ui-datatables" to achieve the sorting, filtering and paging functionality. You have to just pass the JSON object to this component.
Please find the reference below
material-ui-datatables
Title
of a document isFileLeafRef
field. To find if the document is Checked Out useCheckoutUser
field, that will tell you the user who checked out the document.