Skip to content

Commit

Permalink
remaining demos
Browse files Browse the repository at this point in the history
  • Loading branch information
DanailH committed Nov 3, 2021
1 parent 1d8ba55 commit 459c224
Show file tree
Hide file tree
Showing 38 changed files with 172 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<DataGrid
{...data}
components={{
Toolbar: CustomToolbar,
}}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<DataGrid
{...data}
density="compact"
components={{
Toolbar: CustomToolbar,
}}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid {...data} disableColumnMenu />
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGridPro {...data} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<DataGrid
{...data}
components={{
Toolbar: GridToolbar,
}}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid rows={rows} columns={columns} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<DataGrid
{...data}
components={{
Toolbar: CustomToolbar,
}}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<DataGrid
{...data}
components={{
Toolbar: GridToolbar,
}}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<DataGrid
onCellDoubleClick={(params, event) => {
if (!event.ctrlKey) {
event.defaultMuiPrevented = true;
}
}}
{...data}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<DataGrid
{...data}
components={{
Toolbar: CustomToolbar,
}}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<DataGrid
{...data}
columns={data.columns.map((column) => ({
...column,
filterable: false,
}))}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid rows={data.rows} columns={columns} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<DataGridPro
{...data}
filterModel={filterModel}
onFilterModelChange={(model) => setFilterModel(model)}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<DataGrid
rows={rows}
columns={columns}
filterMode="server"
onFilterModelChange={onFilterChange}
loading={loading}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<DataGrid autoHeight {...data} />
<p>more content</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div style={{ height: 350, width: '100%' }}>
<DataGrid {...data} />
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div style={{ display: 'flex', height: '100%' }}>
<div style={{ flexGrow: 1 }}>
<DataGrid {...data} />
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<DataGrid
{...data}
localeText={{
toolbarDensity: 'Size',
toolbarDensityLabel: 'Size',
toolbarDensityCompact: 'Small',
toolbarDensityStandard: 'Medium',
toolbarDensityComfortable: 'Large',
}}
components={{
Toolbar: GridToolbar,
}}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<DataGrid
rows={rows}
columns={columns}
pageSize={5}
rowsPerPageOptions={[5]}
checkboxSelection
disableSelectionOnClick
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<DataGridPro
{...data}
loading={data.rows.length === 0}
rowHeight={38}
checkboxSelection
disableSelectionOnClick
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGridPro pagination pageSize={200} rowsPerPageOptions={[200]} {...data} />
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid autoPageSize pagination {...data} />
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid pagination {...data} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<DataGrid
page={page}
onPageChange={(newPage) => setPage(newPage)}
pageSize={5}
rowsPerPageOptions={[5]}
pagination
{...data}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<DataGrid
pageSize={pageSize}
onPageSizeChange={(newPageSize) => setPageSize(newPageSize)}
rowsPerPageOptions={[5, 10, 20]}
pagination
{...data}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGridPro rows={rows} columns={columns} apiRef={apiRef} />
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid rowHeight={25} {...data} />
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid checkboxSelection {...data} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<DataGrid
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel(newSelectionModel);
}}
selectionModel={selectionModel}
{...data}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid checkboxSelection disableSelectionOnClick {...data} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<DataGrid
{...data}
isRowSelectable={(params: GridRowParams) => params.row.quantity > 50000}
checkboxSelection
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid {...data} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<DataGrid
{...data}
sortModel={sortModel}
onSortModelChange={(model) => setSortModel(model)}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<DataGrid
sortModel={sortModel}
rows={rows}
columns={columns}
onSortModelChange={(model) => setSortModel(model)}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<DataGrid
{...data}
columns={data.columns.map((column) => ({
...column,
sortable: false,
}))}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<DataGridPro
{...data}
sortModel={sortModel}
onSortModelChange={(model) => setSortModel(model)}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<DataGrid
sortingOrder={['desc', 'asc']}
sortModel={sortModel}
onSortModelChange={(model) => setSortModel(model)}
{...data}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DataGrid rows={rows} columns={columns} />

0 comments on commit 459c224

Please sign in to comment.