Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Domino987 committed Jul 26, 2021
2 parents e02af78 + 66be3ae commit 72fbd53
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 7 deletions.
59 changes: 54 additions & 5 deletions __tests__/demo/demo-components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,46 @@ import MaterialTable, { MTableBodyRow, MTableEditRow } from '../../../src'; // r
export { default as EditableRowDateColumnIssue } from './EditableRowDateColumnIssue';

const global_data = [
{ name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 },
{
name: 'Zerya Betül',
surname: 'Baran',
birthYear: 2017,
birthCity: 34,
id: 1
},
{ name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 },
{
name: 'Zerya Betül',
surname: 'Baran',
birthYear: 2017,
birthCity: 34,
id: 1
},
{ name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 },
{
name: 'Zerya Betül',
surname: 'Baran',
birthYear: 2017,
birthCity: 34,
id: 1
},
{ name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 },
{
name: 'Zerya Betül',
surname: 'Baran',
birthYear: 2017,
birthCity: 34,
id: 1
},
{ name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 },
{
name: 'Zerya Betül',
surname: 'Baran',
birthYear: 2017,
birthCity: 34,
id: 1
},
{ name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63, id: 0 },
{
name: 'Zerya Betül',
Expand Down Expand Up @@ -35,13 +75,21 @@ const global_data_CustomExport = [
];

const global_cols = [
{ title: 'Name', field: 'name' },
{ title: 'Surname', field: 'surname' },
{ title: 'Birth Year', field: 'birthYear', type: 'numeric' },
{ title: 'Name', field: 'name', minWidth: 140, maxWidth: 400 },
{ title: 'Surname', field: 'surname', minWidth: 140, maxWidth: 400 },
{
title: 'Birth Year',
field: 'birthYear',
type: 'numeric',
minWidth: 140,
maxWidth: 400
},
{
title: 'Birth Place',
field: 'birthCity',
lookup: { 34: 'İstanbul', 63: 'Şanlıurfa' }
lookup: { 34: 'İstanbul', 63: 'Şanlıurfa' },
minWidth: 140,
maxWidth: 400
}
];

Expand Down Expand Up @@ -553,7 +601,8 @@ export function Resizable() {
data={global_data}
options={{
columnResizable: true,
tableLayout: 'fixed'
tableLayout: 'fixed',
paging: true
}}
/>
);
Expand Down
Binary file added material-table-core-3.1.0.tgz
Binary file not shown.
3 changes: 2 additions & 1 deletion src/components/MTableHeader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export function MTableHeader({ onColumnResized, ...props }) {
let currentWidth = th && +window.getComputedStyle(th).width.slice(0, -2);
let realWidth =
currentWidth -
resizingColumnDef.tableData.additionalWidth -
resizingColumnDef.tableData.additionalWidth +
lastAdditionalWidth -
lastX +
e.clientX;
if (realWidth <= resizingColumnDef.minWidth && realWidth < currentWidth)
Expand Down
1 change: 0 additions & 1 deletion src/components/m-table-body-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ export default function MTableBodyRow(props) {
onClick={(e) => e.stopPropagation()}
value={props.data.tableData.id.toString()}
onChange={(event) => {
console.log('call');
props.onRowSelected(event, props.path, props.data);
}}
style={styles}
Expand Down

0 comments on commit 72fbd53

Please sign in to comment.