Fixed lints
parent
772eb9e819
commit
cf556c5d3d
|
@ -15,15 +15,15 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
_rows: null
|
children: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this._rows = this.$children;
|
this.children = this.$children;
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rows() {
|
rows() {
|
||||||
return this._rows;
|
return this.children;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1155,8 +1155,6 @@ export default {
|
||||||
event.currentTarget.draggable = false;
|
event.currentTarget.draggable = false;
|
||||||
},
|
},
|
||||||
onRowDrop(event) {
|
onRowDrop(event) {
|
||||||
let rowElement = event.currentTarget;
|
|
||||||
|
|
||||||
if (this.droppedRowIndex != null) {
|
if (this.droppedRowIndex != null) {
|
||||||
let dropIndex = (this.draggedRowIndex > this.droppedRowIndex) ? this.droppedRowIndex : (this.droppedRowIndex === 0) ? 0 : this.droppedRowIndex - 1;
|
let dropIndex = (this.draggedRowIndex > this.droppedRowIndex) ? this.droppedRowIndex : (this.droppedRowIndex === 0) ? 0 : this.droppedRowIndex - 1;
|
||||||
let processedData = [...this.processedData];
|
let processedData = [...this.processedData];
|
||||||
|
@ -1207,7 +1205,6 @@ export default {
|
||||||
})];
|
})];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return columns;
|
return columns;
|
||||||
},
|
},
|
||||||
headerColumnGroup() {
|
headerColumnGroup() {
|
||||||
|
|
|
@ -246,8 +246,8 @@ export default {
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>reorderableColumn</td>
|
<td>reorderableColumn</td>
|
||||||
<td>string</td>
|
<td>boolean</td>
|
||||||
<td>null</td>
|
<td>true</td>
|
||||||
<td>Defines if the column itself can be reordered with dragging.</td>
|
<td>Defines if the column itself can be reordered with dragging.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -630,8 +630,7 @@ data() {
|
||||||
</CodeHighlight>
|
</CodeHighlight>
|
||||||
|
|
||||||
<h3>Column Reorder</h3>
|
<h3>Column Reorder</h3>
|
||||||
<p>Columns can be reordered using drag drop by setting the <i>reorderableColumns</i> to true. <i>column-reorder</i> is a callback that is invoked when a column is reordered.
|
<p>Columns can be reordered using drag drop by setting the <i>reorderableColumns</i> to true. <i>column-reorder</i> is a callback that is invoked when a column is reordered. DataTable keeps the column order state internally using keys that identifies a column using the field property. If the column has no field, use columnKey instead.</p>
|
||||||
DataTable keeps the column order state internally using keys that identifies a column using the field property. If the column has no field, use columnKey instead.</p>
|
|
||||||
<CodeHighlight>
|
<CodeHighlight>
|
||||||
<template v-pre>
|
<template v-pre>
|
||||||
<DataTable :value="cars" :reorderableColumns="true">
|
<DataTable :value="cars" :reorderableColumns="true">
|
||||||
|
@ -644,8 +643,7 @@ data() {
|
||||||
</CodeHighlight>
|
</CodeHighlight>
|
||||||
|
|
||||||
<h3>Row Reorder</h3>
|
<h3>Row Reorder</h3>
|
||||||
<p>Data can be reordered using drag drop by adding a reorder column that will display an icon as a drag handle.
|
<p>Data can be reordered using drag drop by adding a reorder column that will display an icon as a drag handle. "row-reorder" is a mandatory callback that is invoked when a column is reordered, use this event to update the new order. Note that the reorder icon can be customized using <i>rowReorderIcon</i> of the column component.</p>
|
||||||
"row-reorder" is a mandatory callback that is invoked when a column is reordered, use this event to update the new order. Note that the reorder icon can be customized using <i>rowReorderIcon</i> of the column component.</p>
|
|
||||||
<CodeHighlight>
|
<CodeHighlight>
|
||||||
<template v-pre>
|
<template v-pre>
|
||||||
<DataTable :value="cars" @row-reorder="onRowReorder">
|
<DataTable :value="cars" @row-reorder="onRowReorder">
|
||||||
|
|
|
@ -72,7 +72,6 @@ export default {
|
||||||
<script>
|
<script>
|
||||||
import CarService from '../../service/CarService';
|
import CarService from '../../service/CarService';
|
||||||
import DataTableSubMenu from './DataTableSubMenu';
|
import DataTableSubMenu from './DataTableSubMenu';
|
||||||
import DataTableDoc from './DataTableDoc';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
@ -96,7 +95,7 @@ export default {
|
||||||
this.carService.getCarsSmall().then(data => this.cars = data);
|
this.carService.getCarsSmall().then(data => this.cars = data);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onColReorder(event) {
|
onColReorder() {
|
||||||
this.$toast.add({severity:'success', summary: 'Column Reordered', life: 3000});
|
this.$toast.add({severity:'success', summary: 'Column Reordered', life: 3000});
|
||||||
},
|
},
|
||||||
onRowReorder(event) {
|
onRowReorder(event) {
|
||||||
|
@ -105,7 +104,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
'DataTableDoc': DataTableDoc,
|
|
||||||
'DataTableSubMenu': DataTableSubMenu
|
'DataTableSubMenu': DataTableSubMenu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue