Skip to content

Commit dfecdfe

Browse files
react - fix selection
1 parent b71ca68 commit dfecdfe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

React/src/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import DataGrid, {
44
} from 'devextreme-react/data-grid';
55
import './App.css';
66
import ArrayStore from 'devextreme/data/array_store';
7-
import { DataSource } from 'devextreme-react/common/data';
7+
import { DataSource, type DataSourceOptions } from 'devextreme-react/common/data';
88
import service, { type City, type Employee } from './data';
99
import MultipleDropDownBox from './components/MultipleDropDownBox';
1010

@@ -20,13 +20,13 @@ const citiesStore = new ArrayStore({
2020
key: 'ID',
2121
});
2222

23-
function getFilteredCities(cellInfo: DataGridTypes.ColumnEditCellTemplateData<Employee, number>, citiesStore: ArrayStore): DataSource {
24-
return new DataSource({
23+
function getFilteredCities(cellInfo: DataGridTypes.ColumnEditCellTemplateData<Employee, number>, citiesStore: ArrayStore): DataSourceOptions {
24+
return {
2525
store: citiesStore,
2626
filter: (data: City) => (cellInfo.data?.StateID && cellInfo.data?.StateID?.length > 0
2727
? cellInfo.data?.StateID.includes(data.StateID)
2828
: true),
29-
});
29+
};
3030
}
3131

3232
async function setStateValue(this: DataGridTypes.Column<Employee, number>, rowData: Employee, value: number[], currentRowData: Employee): Promise<void> {

React/src/components/MultipleDropDownBox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React, { useCallback, useMemo, useReducer } from 'react';
22
import DataGrid, { Column, Selection, type DataGridTypes } from 'devextreme-react/data-grid';
33
import DropDownBox from 'devextreme-react/drop-down-box';
4-
import type { ArrayStore, DataSource } from 'devextreme-react/common/data';
4+
import type { ArrayStore, DataSourceOptions } from 'devextreme-react/common/data';
55
import DropDownBoxSave from './DropDownBoxSave';
66

77
interface MultipleDropDownBoxProps {
88
value: number[];
9-
dataSource: DataSource | ArrayStore;
9+
dataSource: DataSourceOptions | ArrayStore;
1010
// eslint-disable-next-line no-unused-vars
1111
setValue: (newValue: number[]) => void;
1212
}

0 commit comments

Comments
 (0)