Skip to content

Commit 0d864d3

Browse files
committed
Updated documentation for ListView component
1 parent 028062f commit 0d864d3

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

docs/documentation/docs/controls/ListView.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ The Placeholder component can be configured with the following properties:
6767
| selectionMode | SelectionMode | no | Specify if the items in the list view can be selected and how. Options are: none, single, multi. |
6868
| selection | function | no | Selection event that passes the selected item(s) from the list view. |
6969
| groupByFields | IGrouping[] | no | Defines the field on which you want to group the items in the list view. |
70+
| defaultSelection | number[] | no | The index of the items to be select by default |
7071

7172
The `IViewField` has the following implementation:
7273

src/controls/listView/IListView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface IListViewProps {
4141
*/
4242
selection?: (items: any[]) => void;
4343
/**
44-
* The index if items to be select by default.
44+
* The index of the items to be select by default
4545
*/
4646
defaultSelection?: number[];
4747
}

src/controls/listView/ListView.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
5858
* Select all the items that should be selected by default
5959
*/
6060
private _setSelectedItems(): void {
61-
if (this.props.items && this.props.items.length > 0 && this.props.defaultSelection && this.props.defaultSelection.length > 0) {
61+
if (this.props.items &&
62+
this.props.items.length > 0 &&
63+
this.props.defaultSelection &&
64+
this.props.defaultSelection.length > 0) {
6265
for (const index of this.props.defaultSelection) {
6366
if (index > -1) {
6467
this._selection.setIndexSelected(index, true, false);

0 commit comments

Comments
 (0)