Skip to content

Commit

Permalink
Fixed #2115 - New v2 TreeTable showGridlines property
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Feb 4, 2022
1 parent 3926e2f commit f9c0121
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
6 changes: 6 additions & 0 deletions api-generator/components/treetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ const TreeTableProps = [
type: "number",
default: "1",
description: "Indentation factor as rem value for children nodes. Defaults to 1rem."
},
{
name: "showGridlines",
type: "boolean",
default: "false",
description: "Whether to show grid lines between cells."
}
];

Expand Down
1 change: 1 addition & 0 deletions src/components/treetable/TreeTable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ declare class TreeTable extends Vue {
resizableColumns?: boolean;
columnResizeMode?: string;
indentation?: number;
showGridlines?: boolean;
$emit(eventName: 'page', event: Event): this;
$emit(eventName: 'sort', event: Event): this;
$emit(eventName: 'filter', event: Event): this;
Expand Down
7 changes: 6 additions & 1 deletion src/components/treetable/TreeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ export default {
indentation: {
type: Number,
default: 1
},
showGridlines: {
type: Boolean,
default: false
}
},
documentColumnResizeListener: null,
Expand Down Expand Up @@ -753,7 +757,8 @@ export default {
'p-treetable-hoverable-rows': (this.rowHover || this.rowSelectionMode),
'p-treetable-auto-layout': this.autoLayout,
'p-treetable-resizable': this.resizableColumns,
'p-treetable-resizable-fit': this.resizableColumns && this.columnResizeMode === 'fit'
'p-treetable-resizable-fit': this.resizableColumns && this.columnResizeMode === 'fit',
'p-treetable-gridlines': this.showGridlines
}];
},
columns() {
Expand Down
4 changes: 2 additions & 2 deletions src/views/treetable/TreeTableColResizeDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="content-section implementation">
<div class="card">
<h5>Fit Mode</h5>
<TreeTable :value="nodes" :resizableColumns="true" columnResizeMode="fit" class="p-treetable-gridlines">
<TreeTable :value="nodes" :resizableColumns="true" columnResizeMode="fit" showGridlines>
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
Expand All @@ -20,7 +20,7 @@

<div class="card">
<h5>Expand Mode</h5>
<TreeTable :value="nodes" :resizableColumns="true" columnResizeMode="expand" class="p-treetable-gridlines">
<TreeTable :value="nodes" :resizableColumns="true" columnResizeMode="expand" showGridlines>
<Column field="name" header="Name" :expander="true"></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
Expand Down
6 changes: 6 additions & 0 deletions src/views/treetable/TreeTableDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,12 @@ export default {
<td>number</td>
<td>1</td>
<td>Indentation factor as rem value for children nodes. Defaults to 1rem.</td>
</tr>
<tr>
<td>showGridlines</td>
<td>boolean</td>
<td>false</td>
<td>Whether to show grid lines between cells.</td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit f9c0121

Please sign in to comment.