Skip to content

Commit c681f3f

Browse files
committed
combining with #1032; updated docs
1 parent 6df7fea commit c681f3f

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

docs/documentation/docs/controls/ListView.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ import { ListView, IViewField, SelectionMode, GroupOrder, IGrouping } from "@pnp
3737
groupByFields={groupByFields}
3838
dragDropFiles={true}
3939
onDrop={this._getDropFiles}
40-
stickyHeader={true} />
40+
stickyHeader={true}
41+
className={styles.listWrapper}
42+
listClassName={styles.list} />
4143
```
4244
- The control provides full text filtering through all the columns. If you want to execute filtering on the specified columns, you can use syntax : `<ColumndName>`:`<FilterValue>`. Use `':'` as a separator between column name and value. Control support both `'fieldName'` and `'name'` properties of IColumn interface.
4345

@@ -98,6 +100,8 @@ The ListView control can be configured with the following properties:
98100
| onDrop | file | no | Event handler returns files from drag and drop. |
99101
| stickyHeader | boolean | no | Specifies if the header of the `ListView`, including search box, is sticky |
100102
| sortItems | (items: any[], columnName: string, descending: boolean) =&gt; any[] | no | Custom sorting function to handle sorting by column |
103+
| className | string | no | Class name to apply additional styles on list view wrapper |
104+
| listClassName | string | no | Class name to apply additional styles on list view |
101105

102106
The `IViewField` has the following implementation:
103107

src/controls/listView/IListView.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ export interface IListViewProps {
7272
* Class name to apply additional styles on list view wrapper
7373
*/
7474
className?: string;
75+
/**
76+
* Class name to apply additional styles on list view
77+
*/
78+
listClassName?: string;
7579
/**
7680
* Custom sorting function.
7781
* @returns sorted collection of items

src/controls/listView/ListView.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
580580
public render(): React.ReactElement<IListViewProps> {
581581
let groupProps: IGroupRenderProps = {};
582582

583-
let { showFilter, filterPlaceHolder, dragDropFiles, stickyHeader, selectionMode, compact } = this.props;
583+
let { showFilter, filterPlaceHolder, dragDropFiles, stickyHeader, selectionMode, compact, className, listClassName } = this.props;
584584
let { filterValue, items, columns, groups } = this.state;
585585

586586
// Check if selection mode is single selection,
@@ -595,7 +595,7 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
595595
}
596596

597597
return (
598-
<ListViewWrapper stickyHeader={!!this.props.stickyHeader} className={this.props.className}>
598+
<ListViewWrapper stickyHeader={!!stickyHeader} className={className}>
599599
<DragDropFiles enable={dragDropFiles}
600600
iconName="BulkUpload"
601601
labelMessage={strings.UploadFileHeader}
@@ -607,7 +607,7 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
607607
} >
608608
{
609609
showFilter &&
610-
<SearchBoxWrapper stickyHeader={!!this.props.stickyHeader}>
610+
<SearchBoxWrapper stickyHeader={!!stickyHeader}>
611611
<SearchBox placeholder={filterPlaceHolder || strings.ListViewFilterLabel} onSearch={this._updateFilterValue} onChange={(e, value) => this._updateFilterValue(value)} value={filterValue} />
612612
</SearchBoxWrapper>
613613
}
@@ -623,6 +623,7 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
623623
compact={compact}
624624
setKey='ListViewControl'
625625
groupProps={groupProps}
626+
className={listClassName}
626627
onRenderDetailsHeader={this._onRenderDetailsHeader}
627628
componentRef={ref => {
628629
if (ref) {

0 commit comments

Comments
 (0)