Skip to content

Commit

Permalink
Fixed #276
Browse files Browse the repository at this point in the history
  • Loading branch information
Merve7 committed Jan 8, 2018
1 parent 4c9aea3 commit 5f5cc5d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/datatable/DataTable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ interface DataTableProps {
onRowCollapse?(e: {originalEvent: Event, data: any}): void;
onContextMenuSelect?(e: {originalEvent: Event, data: any}): void;
onColReorder?(e: {dragIndex: number, dropIndex: number, columns: any}): void;
paginatorLeft?: any;
paginatorRight?: any;
pageLinkSize?: number;
}

export class DataTable extends React.Component<DataTableProps,any> {}
8 changes: 5 additions & 3 deletions src/components/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export class DataTable extends Component {
onContextMenuSelect: null,
onColReorder: null,
paginatorLeft:null,
paginatorRight: null
paginatorRight: null,
pageLinkSize: 5
}

static propTypes = {
Expand Down Expand Up @@ -156,7 +157,8 @@ export class DataTable extends Component {
onContextMenuSelect: PropTypes.func,
onColReorder: PropTypes.func,
paginatorLeft: PropTypes.any,
paginatorRight: PropTypes.any
paginatorRight: PropTypes.any,
pageLinkSize: PropTypes.number
};

constructor(props) {
Expand Down Expand Up @@ -204,7 +206,7 @@ export class DataTable extends Component {
createPaginator(position, totalRecords, data) {
let className = 'ui-paginator-' + position;

return <Paginator first={this.state.first} rows={this.state.rows} className={className} onPageChange={this.onPageChange} template={this.props.paginatorTemplate}
return <Paginator first={this.state.first} rows={this.state.rows} pageLinkSize={this.props.pageLinkSize} className={className} onPageChange={this.onPageChange} template={this.props.paginatorTemplate}
totalRecords={totalRecords} rowsPerPageOptions={this.props.rowsPerPageOptions} leftContent={this.props.paginatorLeft} rightContent={this.props.paginatorRight}/>;
}

Expand Down
6 changes: 6 additions & 0 deletions src/showcase/datatable/DataTableDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -1466,6 +1466,12 @@ export class DataTableLazyDemo extends Component {
<td>FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown</td>
<td>Template of the paginator.</td>
</tr>
<tr>
<td>pageLinkSize</td>
<td>number</td>
<td>5</td>
<td>Number of page links to display.</td>
</tr>
<tr>
<td>first</td>
<td>number</td>
Expand Down

0 comments on commit 5f5cc5d

Please sign in to comment.