Skip to content

Commit

Permalink
Work
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Feb 2, 2022
1 parent fdcd5a1 commit 23270c4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 50 deletions.
49 changes: 0 additions & 49 deletions docs/src/pages/components/data-grid/components/CustomSortIcons.js
Original file line number Diff line number Diff line change
@@ -1,49 +0,0 @@
import * as React from 'react';
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import { DataGrid } from '@mui/x-data-grid';

export function SortedDescendingIcon() {
return <ExpandMoreIcon className="icon" />;
}

export function SortedAscendingIcon() {
return <ExpandLessIcon className="icon" />;
}

const rows = [
{
id: 1,
name: 'MUI',
stars: 28000,
},
{
id: 2,
name: 'DataGrid',
stars: 15000,
},
];

const columns = [
{ field: 'name', width: 150 },
{ field: 'stars', width: 150 },
];

export default function CustomSortIcons() {
return (
<div style={{ height: 250, width: '100%' }}>
<DataGrid
columns={columns}
rows={rows}
sortModel={[
{ field: 'name', sort: 'asc' },
{ field: 'stars', sort: 'desc' },
]}
components={{
ColumnSortedDescendingIcon: SortedDescendingIcon,
ColumnSortedAscendingIcon: SortedAscendingIcon,
}}
/>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ ViewListItem.propTypes = {
label: PropTypes.string.isRequired,
value: PropTypes.shape({
columns: PropTypes.shape({
columns: PropTypes.arrayOf(PropTypes.object),
columnVisibilityModel: PropTypes.object,
}),
filter: PropTypes.shape({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('<DataGridPro /> - Columns', () => {
</div>
);

describe.only('prop: initialState.columns.columns', () => {
describe('prop: initialState.columns.columns', () => {
it('should allow to initialize the columns order and dimensions', () => {
render(
<TestDataGrid
Expand Down

0 comments on commit 23270c4

Please sign in to comment.