diff --git a/src/views/datatable/DataTableDoc.vue b/src/views/datatable/DataTableDoc.vue index fe6f8d29a..4878ee17d 100755 --- a/src/views/datatable/DataTableDoc.vue +++ b/src/views/datatable/DataTableDoc.vue @@ -377,6 +377,72 @@ export default { +
Name | +Parameters | +
---|---|
header | +column: Column node | +
body | +data: Row data + column: Column node + index: Row index + frozenRow: Is row frozen |
+
footer | +column: Column node | +
editor | +data: Row data + column: Column node + index: Row index + frozenRow: Is row frozen |
+
filter | +field: Column field + filterModel: {value,matchMode} Filter metadata + filterCallback: Callback function |
+
filterheader | +field: Column field + filterModel: {value,matchMode} Filter metadata + filterCallback: Callback function |
+
filterfooter | +field: Column field + filterModel: {value,matchMode} Filter metadata + filterCallback: Callback function |
+
filterclear/td> + | field: Column field + filterModel: {value,matchMode} Filter metadata + filterCallback: Callback function |
+
filterapply | +field: Column field + filterModel: {value,matchMode} Filter metadata + filterCallback: Callback function |
+
Default table-layout is fixed meaning the cell widths do not depend on their content. If you require cells to scale based on their contents set autoLayout property to true. Note that Scrollable and/or Resizable tables do not support auto layout due to technical limitations.
@@ -764,6 +830,29 @@ matchModes: [ ] +Filter menu overlay can be customized even further with various templates including filterheader, filterfooter, filterclear, filterapply. Example here changes the buttons and adds a footer.
+ +
+<Column header="Country" filterField="country.name">
+ <template #filter="{filterModel}">
+ <InputText type="text" v-model="filterModel.value" class="p-column-filter" placeholder="Search by country"/>
+ </template>
+ <template #filterclear="{filterCallback}">
+ <Button type="button" icon="pi pi-times" @click="filterCallback()" class="p-button-secondary"></Button>
+ </template>
+ <template #filterapply="{filterCallback}">
+ <Button type="button" icon="pi pi-check" @click="filterCallback()" class="p-button-success"></Button>
+ </template>
+ <template #filterfooter>
+ <div class="p-px-3 p-pt-0 p-pb-3 p-text-center p-text-bold">Customized Buttons</div>
+ </template>
+</Column>
+
+
+
+
+
DataTable provides single and multiple selection modes on click of a row. Selected rows are bound to the selection property and updated using the v-model directive. Alternatively column based selection can be done using radio buttons or checkboxes using selectionMode of a particular column. In addition row-select and row-unselect @@ -2415,6 +2504,51 @@ export default { +
Name | +Parameters | +
---|---|
header | +- | +
paginatorLeft | +- | +
paginatorRight | +- | +
footer | +- | +
groupheader | +data: Row data + index: Row index |
+
groupfooter | +data: Row data + index: Row index |
+
expansion | +data: Row data + index: Row index |
+
Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.