Comments (9)
@trillian74 can this issue be closed?
from sp-dev-fx-controls-react.
@AJIXuMuK is this something you can do?
@trillian74 what would you like to see being added to the documentation?
from sp-dev-fx-controls-react.
@estruyf, Yep, will be my pleasure.
@trillian74 please, let us know what additional information you'd like to see.
Currently we have few scenarios described on how to use Field Controls including FieldUserRenderer
.
- if you go to Getting started page for Field controls you'll see example on how to use
FieldRendererHelper
that will automatically detect needed type of Field control based on Field Type. - on FieldUserRenderer control page you can find the code that you can use to embed
FieldUserRenderer
into your Field Customizer.
Let us know if you need something more.
from sp-dev-fx-controls-react.
thanx
I'm wondering most upon the users={event.fieldValue}
Normally i just have the siteuserid or login for the user i want to render. I see that it wants IPrincipal. I've tried building one, but no cigar on this control.
from sp-dev-fx-controls-react.
Let say how do i complete this within a listviewfields
private viewFields: Array<IViewField> = [ { name: "Id", displayName: "Id" }, { name: "AuthorId", displayName: "Author", render: ((d: any) => { sp.web.getUserById(d.AuthorId).get().then((user) => {....
i want to render out author as a user control with card?
from sp-dev-fx-controls-react.
@trillian74 what is the scenario where you're trying to use the control?
Basically, Field Controls are implemented to be used in FieldCustomizer extension where you actually have this event.fieldValue
in onRenderCell
handler.
But it looks like you have some custom "list view" control or something.
The IPrincipal
interface looks like that:
/**
* Represents a principal value as it is stored in People and Groups field
*/
export interface IPrincipal {
id: string;
email: string;
department: string;
jobTitle: string;
sip: string;
title: string;
value: string;
picture: string;
}
And it actually represents how the User or Group Field's value is passed to the FieldCustomizer.
You can import it like that:
import { IPrincipal } from "@pnp/spfx-controls-react/lib/FieldCommon";
If you want to use it outside FieldCustomizer you should create the IPrincipal
object by yourself and provide at least values for id
, email
and title
.
from sp-dev-fx-controls-react.
I have this ListView control (in a webpart) that has sp user column, which of course only have Ids like AuthorId etc.... In the ListView i want to render the column using the FieldUserRenderer control.
Is this possible using the ListView and Array with override render?
from sp-dev-fx-controls-react.
@trillian74
I didn't play around with ListView
control and its render
override.
From FieldUserRenderer
point of you - yes, you can do that if you provide the IPrincipal
info as I described above.
from sp-dev-fx-controls-react.
Thanx
from sp-dev-fx-controls-react.
Related Issues (20)
- Vertical and Horizontal Scroll Bar not always visible HOT 2
- HoverReactionBarControl.js / @fluentui/react-positioning/lib/usePositioning - Module parse failed: Unexpected token HOT 7
- TaxonomyPicker Does not allow removing existing selection When the is disabled={!dpcRequest.LockedToMe} HOT 1
- Rich Text Component - Insert image using Copy Paste HOT 3
- Rich Text - Set default font size HOT 2
- [Dynamic Form] Update Form crashes on loading, if an item has TaxonomyFieldTypeMulti field. [3.16.1] !!! HOT 21
- FilePicker - best practice for storing files (images) uploaded via SPFX? HOT 1
- Unable to install latest version due to dependency HOT 4
- Error on rendering DynamicForm when having a Date Field with internal name starting with underscore ("_") HOT 3
- People picker issue when try to search by full name but works with upn HOT 7
- Documentation site unreadable with Edge, black on black HOT 3
- TaxonomyPicker continuously shows spinner instead of suggestion when typing and throw error in console HOT 6
- Treeview defaultexpanded state never changes HOT 2
- Treeview control, default selected key focus HOT 1
- Dynamic form loading error in other site HOT 5
- [DynamicForm] Issue when loading data from TaxonomyFieldTypeMulti, `results` sub-array appears randomly HOT 1
- [Dynamic Form][3.17] Required Field Validation won't work HOT 1
- Module not found - Wrong @fluentui imports cause webpack build errors HOT 8
- FilePicker can't browse "Your organisation" tab when used in webpart on the root/home SharePoint site HOT 1
- SitePicker, ListPicker & FieldPicker occasionally show options in background when using it in a dialog HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sp-dev-fx-controls-react.