Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #2255 #2280

Merged
merged 1 commit into from
Mar 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/datalist/datalist.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
.ui-datalist .ui-datalist-data > li {
list-style-type: none;

}

.ui-datalist .ui-datalist-emptymessage {
padding: .5em .75em;
}
3 changes: 3 additions & 0 deletions components/datalist/datalist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {BlockableUI} from '../common/api';
<p-paginator [rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks"
(onPageChange)="paginate($event)" styleClass="ui-paginator-bottom" [rowsPerPageOptions]="rowsPerPageOptions" *ngIf="paginator && paginatorPosition!='bottom' || paginatorPosition =='both'"></p-paginator>
<div class="ui-datalist-content ui-widget-content">
<div *ngIf="isEmpty()" class="ui-datalist-emptymessage">{{emptyMessage}}</div>
<ul class="ui-datalist-data">
<li *ngFor="let item of dataToRender;let i = index">
<ng-template [pTemplateWrapper]="itemTemplate" [item]="item" [index]="i"></ng-template>
Expand Down Expand Up @@ -51,6 +52,8 @@ export class DataList implements AfterViewInit,AfterContentInit,DoCheck,Blockabl
@Input() styleClass: string;

@Input() paginatorPosition: string = 'bottom';

@Input() emptyMessage: string = 'No records found';

@Output() onPage: EventEmitter<any> = new EventEmitter();

Expand Down
10 changes: 10 additions & 0 deletions showcase/demo/datalist/datalistdemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ <h3>Attributes</h3>
<td>bottom</td>
<td>Position of the paginator, options are "top","bottom" or "both".</td>
</tr>
<tr>
<td>emptyMessage</td>
<td>string</td>
<td>No records found.</td>
<td>Text to display when there is no data.</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -342,6 +348,10 @@ <h3>Styling</h3>
<td>ui-datalist-data</td>
<td>Item container element.</td>
</tr>
<tr>
<td>ui-datalist-emptymessage</td>
<td>Element containing the empty message.</td>
</tr>
</tbody>
</table>
</div>
Expand Down