export default class AgreementContainer extends React.Component<IAgreementContainerProps, IAgreementContainerState> {
constructor(props: IAgreementContainerProps) {
super(props);
this.state = {
agreements: []
}
};
private viewFields: IViewField[] = [
{
name: "AgreementName",
linkPropertyName: "AgreementName.ServerRelativeUrl",
displayName: "Agreement Name",
maxWidth: 25,
minWidth: 25,
sorting: true,
isResizable: true
},
{
name: "CustomerAgreementNr",
displayName: "Customer Agreement Nr",
maxWidth: 4,
isResizable: true
}
]
public componentDidMount(): void {
this.props.provider.getAgreements().then((agreements) => {
this.setState({
agreements: agreements
});
});
}
public render(): JSX.Element {
console.log(this.state.agreements);
return (
<div className={ styles.agreementDatabase }>
<ListView
items = {this.state.agreements}
viewFields={this.viewFields}
/>
</div>
);
}
}
}