Skip to content

Commit

Permalink
Fix for primefaces#2255
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvanryckeghem committed Mar 12, 2017
1 parent b57ee1c commit 4d06c8f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
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

0 comments on commit 4d06c8f

Please sign in to comment.