diff --git a/src/views/datatable/DataTableTemplatingDemo.vue b/src/views/datatable/DataTableTemplatingDemo.vue
index 24778c195..ca2be3730 100755
--- a/src/views/datatable/DataTableTemplatingDemo.vue
+++ b/src/views/datatable/DataTableTemplatingDemo.vue
@@ -43,8 +43,6 @@
-
-
diff --git a/src/views/overlaypanel/OverlayPanelDemo.vue b/src/views/overlaypanel/OverlayPanelDemo.vue
index 63272ce82..985617ddc 100755
--- a/src/views/overlaypanel/OverlayPanelDemo.vue
+++ b/src/views/overlaypanel/OverlayPanelDemo.vue
@@ -3,16 +3,28 @@
OverlayPanel
-
OverlayPanel is a container component that can overlay other components on page.
+
OverlayPanel is a container component positioned as connected to its target.
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+ {{formatCurrency(slotProps.data.price)}}
+
+
+
@@ -22,16 +34,48 @@
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/src/views/overlaypanel/OverlayPanelDoc.vue b/src/views/overlaypanel/OverlayPanelDoc.vue
index 517578fd7..972374f36 100755
--- a/src/views/overlaypanel/OverlayPanelDoc.vue
+++ b/src/views/overlaypanel/OverlayPanelDoc.vue
@@ -152,21 +152,55 @@ toggle(event) {
-<Button type="button" label="Toggle" @click="toggle" aria:haspopup="true" aria-controls="overlay_panel"/>
+<Button type="button" icon="pi pi-search" :label="selectedProduct ? selectedProduct.name : 'Select a Product'" @click="toggle" aria:haspopup="true" aria-controls="overlay_panel" />
-<OverlayPanel ref="op" id="overlay_panel">
- <img src="demo/images/nature/nature1.jpg" alt="Nature Image">
+<OverlayPanel ref="op" appendTo="body" :showCloseIcon="true" id="overlay_panel" style="width: 450px">
+ <DataTable :value="products" :selection.sync="selectedProduct" selectionMode="single" :paginator="true" :rows="5" @row-select="onProductSelect">
+ <Column field="name" header="Name" sortable></Column>
+ <Column header="Image">
+ <template #body="slotProps">
+ <img :src="'demo/images/product/' + slotProps.data.image" :alt="slotProps.data.image" class="product-image" />
+ </template>
+ </Column>
+ <Column field="price" header="Price" sortable>
+ <template #body="slotProps">
+ {{formatCurrency(slotProps.data.price)}}
+ </template>
+ </Column>
+ </DataTable>
</OverlayPanel>
+import ProductService from '../../service/ProductService';
+
export default {
- methods: {
- toggle(event) {
- this.$refs.op.toggle(event);
- }
- }
+ data() {
+ return {
+ products: null,
+ selectedProduct: null
+ }
+ },
+ productService: null,
+ created() {
+ this.productService = new ProductService();
+ },
+ mounted() {
+ this.productService.getProductsSmall().then(data => this.products = data);
+ },
+ methods: {
+ toggle(event) {
+ this.$refs.op.toggle(event);
+ },
+ formatCurrency(value) {
+ return value.toLocaleString('en-US', {style: 'currency', currency: 'USD'});
+ },
+ onProductSelect(event) {
+ this.$refs.op.hide();
+ this.$toast.add({severity:'info', summary: 'Product Select', detail: event.data.name, life: 3000});
+ }
+ }
}