Finished paginator docs and added image gallery demo
parent
b7f9f05649
commit
71c9427dbc
|
@ -12,14 +12,18 @@
|
|||
<Paginator :first.sync="first" :rows.sync="rows" :totalRecords="totalRecords" :rowsPerPageOptions="[10,20,30]"></Paginator>
|
||||
|
||||
<h3>Custom Template</h3>
|
||||
<Paginator :first="first2" :rows="rows2" :totalRecords="totalRecords2" @page-change="onPageChangeCustom($event)" template="FirstPageLink PrevPageLink CurrentPageReport NextPageLink LastPageLink">
|
||||
<Paginator :first.sync="first2" :rows="1" :totalRecords="totalRecords2" @page-change="onPageChangeCustom($event)" template="FirstPageLink PrevPageLink CurrentPageReport NextPageLink LastPageLink">
|
||||
<template #left>
|
||||
<Button type="button" icon="pi pi-refresh" />
|
||||
<Button type="button" icon="pi pi-refresh" @click="reset()"/>
|
||||
</template>
|
||||
<template #right>
|
||||
<Button type="button" icon="pi pi-search" />
|
||||
</template>
|
||||
</Paginator>
|
||||
|
||||
<div class="image-gallery">
|
||||
<img :src="'/demo/images/nature/' + image + '.jpg'" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PaginatorDoc />
|
||||
|
@ -36,14 +40,17 @@ export default {
|
|||
rows: 10,
|
||||
totalRecords: 50,
|
||||
first2: 0,
|
||||
rows2: 1,
|
||||
totalRecords2: 12
|
||||
totalRecords2: 12,
|
||||
image: 'nature1'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onPageChangeCustom(event) {
|
||||
this.first2 = event.first;
|
||||
this.rows2 = event.rows;
|
||||
this.image = 'nature' + (event.page + 1);
|
||||
},
|
||||
reset() {
|
||||
this.first2 = 0;
|
||||
this.image = 'nature1';
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
@ -52,8 +59,13 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style scoped>
|
||||
.p-button.p-button-icon-only {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.image-gallery {
|
||||
text-align: center;
|
||||
padding: 1em;
|
||||
}
|
||||
</style>
|
|
@ -77,7 +77,6 @@ onPage(event) {
|
|||
//event.page: New page number
|
||||
//event.first: Index of first record
|
||||
//event.rows: Number of rows to display in new page
|
||||
//event.page: Index of the new page
|
||||
//event.pageCount: Total number of pages
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
@ -156,7 +155,6 @@ onPage(event) {
|
|||
<td>event.page: New page number <br/>
|
||||
event.first: Index of first record <br/>
|
||||
event.rows: Number of rows to display in new page <br/>
|
||||
event.page: Index of the new page <br/>
|
||||
event.pageCount: Total number of pages
|
||||
</td>
|
||||
<td>Callback to invoke when page changes, the event object contains information about the new state.</td>
|
||||
|
@ -222,51 +220,76 @@ onPage(event) {
|
|||
</a>
|
||||
<CodeHighlight>
|
||||
<template>
|
||||
<div>
|
||||
<div class="content-section introduction">
|
||||
<div class="feature-intro">
|
||||
<h1>Paginator</h1>
|
||||
<p>Paginator is a generic component to display content in paged format.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="content-section introduction">
|
||||
<div class="feature-intro">
|
||||
<h1>Paginator</h1>
|
||||
<p>Paginator is a generic component to display content in paged format.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-section implementation">
|
||||
<h3 class="first">Default</h3>
|
||||
<Paginator :first.sync="first" :rows.sync="rows" :totalRecords="totalRecords" :rowsPerPageOptions="[10,20,30]"></Paginator>
|
||||
<div class="content-section implementation">
|
||||
<h3 class="first">Default</h3>
|
||||
<Paginator :first.sync="first" :rows.sync="rows" :totalRecords="totalRecords" :rowsPerPageOptions="[10,20,30]"></Paginator>
|
||||
|
||||
<h3>Custom Template</h3>
|
||||
<Paginator :first="first2" :rows="rows2" :totalRecords="totalRecords2" @page-change="onPageChangeCustom($event)" template="FirstPageLink PrevPageLink CurrentPageReport NextPageLink LastPageLink">
|
||||
<h3>Custom Template</h3>
|
||||
<Paginator :first.sync="first2" :rows="1" :totalRecords="totalRecords2" @page-change="onPageChangeCustom($event)" template="FirstPageLink PrevPageLink CurrentPageReport NextPageLink LastPageLink">
|
||||
<template #left>
|
||||
<Button type="button" icon="pi pi-refresh" />
|
||||
<Button type="button" icon="pi pi-refresh" @click="reset()"/>
|
||||
</template>
|
||||
<template #right>
|
||||
<Button type="button" icon="pi pi-search" />
|
||||
</template>
|
||||
</Paginator>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="image-gallery">
|
||||
<img :src="'/demo/images/nature/' + image + '.jpg'" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PaginatorDoc />
|
||||
</div>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
import PaginatorDoc from './PaginatorDoc';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
first: 0,
|
||||
first: 0,
|
||||
rows: 10,
|
||||
totalRecords: 50,
|
||||
first2: 0,
|
||||
rows2: 1,
|
||||
totalRecords2: 12
|
||||
totalRecords2: 12,
|
||||
image: 'nature1'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onPageChangeCustom(event) {
|
||||
this.first2 = event.first;
|
||||
this.rows2 = event.rows;
|
||||
this.image = 'nature' + (event.page + 1);
|
||||
},
|
||||
reset() {
|
||||
this.first2 = 0;
|
||||
this.image = 'nature1';
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'PaginatorDoc': PaginatorDoc
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
.p-button.p-button-icon-only {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.image-gallery {
|
||||
text-align: center;
|
||||
padding: 1em;
|
||||
}
|
||||
</CodeHighlight>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
|
|
Loading…
Reference in New Issue