Skip to content

Commit 58a25c7

Browse files
committed
Enhancement for #119
1 parent cd9b303 commit 58a25c7

File tree

7 files changed

+21
-13
lines changed

7 files changed

+21
-13
lines changed

CHANGELOG.JSON

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"enhancements": [
88
"`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)",
99
"`WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)",
10-
"`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)"
10+
"`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)",
11+
"`ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)"
1112
],
1213
"fixes": []
1314
},

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)
88
- `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)
99
- `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)
10+
- `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)
1011

1112
## 1.7.0
1213

docs/documentation/docs/about/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)
88
- `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)
99
- `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)
10+
- `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)
1011

1112
## 1.7.0
1213

docs/documentation/docs/controls/ListView.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ The `IViewField` has the following implementation:
8282
| sorting | boolean | no | Specify if you want to enable sorting for the current field. |
8383
| maxWidth | number | no | Specify the minimum width of the column. |
8484
| maxWidth | number | no | Specify the maximum width of the column. |
85+
| isResizable | boolean | no | Determines if the column can be resized. |
8586
| render | function | no | Override how the field has to get rendered. |
8687

8788
The `IGrouping` has the following implementation:

src/controls/listView/IListView.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Selection, SelectionMode } from 'office-ui-fabric-react/lib/DetailsList';
22
import { IColumn, IGroup } from 'office-ui-fabric-react/lib/components/DetailsList';
3-
import { IDetailsListProps } from "office-ui-fabric-react/lib/DetailsList";
43

54
export { SelectionMode };
65

@@ -45,10 +44,6 @@ export interface IListViewProps {
4544
* The index of the items to be select by default
4645
*/
4746
defaultSelection?: number[];
48-
/**
49-
* Specify direct properties for the DetailsList component
50-
*/
51-
detailsListProps?: IDetailsListProps;
5247
}
5348

5449
export interface IListViewState {
@@ -102,6 +97,10 @@ export interface IViewField {
10297
* Specify the maximum width of the column
10398
*/
10499
maxWidth?: number;
100+
/**
101+
* Determines if the column can be resized.
102+
*/
103+
isResizable?: boolean;
105104
/**
106105
* Override the render method of the field
107106
*/

src/controls/listView/ListView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
277277
fieldName: field.name,
278278
minWidth: field.minWidth || 50,
279279
maxWidth: field.maxWidth,
280+
isResizable: field.isResizable,
280281
onRender: this._fieldRender(field),
281282
onColumnClick: this._columnClick
282283
});
@@ -399,8 +400,7 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
399400
layoutMode={DetailsListLayoutMode.justified}
400401
compact={this.props.compact}
401402
setKey="ListViewControl"
402-
groupProps={groupProps}
403-
{...this.props.detailsListProps} />
403+
groupProps={groupProps} />
404404
</div>
405405
);
406406
}

src/webparts/controlsTest/components/ControlsTest.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,27 +143,32 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
143143
name: 'ListItemAllFields.Id',
144144
displayName: 'ID',
145145
maxWidth: 40,
146-
sorting: true
146+
sorting: true,
147+
isResizable: true
147148
},
148149
{
149150
name: 'ListItemAllFields.Underscore_Field',
150151
displayName: "Underscore_Field",
151-
sorting: true
152+
sorting: true,
153+
isResizable: true
152154
},
153155
{
154156
name: 'Name',
155157
linkPropertyName: 'ServerRelativeUrl',
156-
sorting: true
158+
sorting: true,
159+
isResizable: true
157160
},
158161
{
159162
name: 'ServerRelativeUrl',
160163
displayName: 'Path',
161164
render: (item: any) => {
162165
return <a href={item['ServerRelativeUrl']}>Link</a>;
163-
}
166+
},
167+
isResizable: true
164168
},
165169
{
166-
name: 'Title'
170+
name: 'Title',
171+
isResizable: true
167172
}
168173
];
169174

0 commit comments

Comments
 (0)