2.0.65 • Published 2 years ago

jitz-office-fabric-sharepoint-react-controls v2.0.65

Weekly downloads
1
License
ISC
Repository
-
Last release
2 years ago

JitzOfficeFabricSharePointReactControls

Office fabric UI React controls for SharePoint Framework(SPFx) extended to connect to SharePoint

Getting Started

The package depends on the packages generated by Yoeman generator for SPFx template

Prerequisites

Create the SPFx project according to Microsoft's documentation

How to use

Install the package using the command below

npm i jitz-office-fabric-sharepoint-react-controls

Import the package in your React component

import {JitzPeoplePicker} from 'jitz-office-fabric-sharepoint-react-controls/lib/controls/JitzPeoplePicker';
import {JitzDatePicker} from 'jitz-office-fabric-sharepoint-react-controls/lib/controls/JitzDatePicker';
import { JitzGrid } from 'jitz-office-fabric-sharepoint-react-controls/lib/controls/JitzGrid';

People picker usage

<JitzPeoplePicker description={""} spHttpClient={this.props.context.spHttpClient}
       siteUrl={this.props.context.pageContext.site.absoluteUrl} typePicker={"Normal"} 
       errorMessage={this.state.errorMessage}
       principalTypeUser={true} principalTypeSharePointGroup={false}   
       disabled={false}                                             
       principalTypeSecurityGroup={false}
       multiSelect={false}
       principalTypeDistributionList={false} 
       onChange={ (vals) => this.changeEvent(vals)} 
       numberOfItems={10} 
       prePopulatedItems={[this.state.arrayOfLoginNames]} 
       >
</JitzPeoplePicker>

Date Picker Usage

<JitzDatePicker value={session.startDate}     
disabled={false}                                                           
onSelectDate={(date)=>{this.sessionProperty<Date>(date,"startDate",index);}} /> 

Grid Usage

<JitzGrid key='Title' items={this.state.items} 
    renderCustomColumns={(fieldContent,fieldName)=>{ return this.renderCustomColumns(fieldContent,fieldName);}}
    modifyColumns={(col)=>{return this.modifyColumns(col);}}
    onItemSelect={(items)=>{this.setSelectedItems(items);}} 
    onItemInvoked={(item,index)=>{this.itemInvoked(item,index);}}/>

    renderCustomColumns=(fieldContent:any,fieldName:string)=>{
              if(fieldName === 'date'){     
                    return <span>{this.formatDate(fieldContent)}</span>;
                }
              else {
                  return <span>{fieldContent}</span>;
                }
        }
    
    modifyColumns = (columns: IColumn[]) =>{
           columns.map((column,index)=>{
              switch(column.key){
                  case "fieldName":{
                      column.name = "Coulmn Name";
                      break;
                  }
                  default:{
                      break;
                  }
              }
           });
           return columns;
         }
    
    setSelectedItems = (items:IGridItem[])=>{
             if(items.length> 0){
                 this.setState({selectedItemId:items[0].id});
             }
             else{
                 this.setState({selectedItemId:undefined});
             }
           }

    itemInvoked = (item:any, index:number|undefined) => {
            this.setState({selectedItemId:item.id});
         }

Keywords

SPFx Office Fabric UI React SharePoint

2.0.65

2 years ago

2.0.64

3 years ago

2.0.62

3 years ago

2.0.63

3 years ago

2.0.61

3 years ago

2.0.59

3 years ago

2.0.60

3 years ago

2.0.58

3 years ago

2.0.57

3 years ago

2.0.56

3 years ago

2.0.55

3 years ago

2.0.53

3 years ago

2.0.54

3 years ago

2.0.51

3 years ago

2.0.52

3 years ago

2.0.50

3 years ago

2.0.49

3 years ago

2.0.48

4 years ago

2.0.47

4 years ago

2.0.46

4 years ago

2.0.45

4 years ago

2.0.44

4 years ago

2.0.42

4 years ago

2.0.43

4 years ago

2.0.41

4 years ago

2.0.40

4 years ago

2.0.38

4 years ago

2.0.39

4 years ago

2.0.37

4 years ago

2.0.36

4 years ago

2.0.35

4 years ago

2.0.33

4 years ago

2.0.34

4 years ago

2.0.31

4 years ago

2.0.32

4 years ago

2.0.30

4 years ago

2.0.29

4 years ago

2.0.28

4 years ago

2.0.27

4 years ago

2.0.26

4 years ago

2.0.24

4 years ago

2.0.25

4 years ago

2.0.22

4 years ago

2.0.23

4 years ago

2.0.21

4 years ago

2.0.20

4 years ago

2.0.19

4 years ago

2.0.18

4 years ago

2.0.16

4 years ago

2.0.17

4 years ago

2.0.15

4 years ago

2.0.14

4 years ago

2.0.13

4 years ago

2.0.11

4 years ago

2.0.7

4 years ago

2.0.12

4 years ago

2.0.6

4 years ago

2.0.10

4 years ago

2.0.8

4 years ago

2.0.5

4 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago