question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Listview: how to generate iconFieldName

See original GitHub issue

My list view is displaying a list of .pdf and I just want to show their respective icons.

iconFieldName="ServerRelativeUrl"

Documentation states:

Specify the items’ property name that defines the file URL path

My items do not have a RelativeUrl property but they do have a ServerRedirectedEmbedUri, what property am I looking for here?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
scallincommented, Apr 23, 2020

The FileRef field seems to work

sp.web.lists.getByTitle(Constants.libraryName).items
            .select('ID, Title, Author/Title, FileRef, Created, Modified, File')
            .expand('Author, File')
            .orderBy('Title')
            .get().then((data: any[]) => {
                console.log(data);
                this.setState({
                    items: data,
                    isLoading: false,
                });
            })
            .catch((err : any) => {
                console.dir(err);
        });
<ListView
  items={this.state.items}
  viewFields={viewFields}
  iconFieldName="FileRef"
  compact={true}
  selectionMode={SelectionMode.none}
  groupByFields={groupByFields}                        
  showFilter={false} />

image

0reactions
msftbot[bot]commented, Apr 26, 2021

Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Listview: how to generate iconFieldName · Issue #396 - GitHub
My list view is displaying a list of .pdf and I just want to show their respective icons. iconFieldName="ServerRelativeUrl" Documentation ...
Read more >
ListView - @pnp/spfx-controls-react
This control renders a list view for the given set of items. ... items={items} viewFields={viewFields} iconFieldName="ServerRelativeUrl" compact={true} ...
Read more >
Displaying an icon in the ListView column - Stack Overflow
This answer shows how to make ListView display and ...
Read more >
PnP ListView in the SharePoint Framework (SPFx) webpart
Enter the webpart name as your solution name, and then select Enter. Select Create a subfolder with solution name for where to place...
Read more >
List View in Spfx - C# Corner
cd spfx-SpfxListView. Run the Yeoman SharePoint Generator to create the solution. yo @microsoft/sharepoint. Solution Name.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found