Skip to content

Commit

Permalink
Fixed #3963
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Oct 24, 2017
1 parent 0a18d0d commit 1aacc33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
14 changes: 2 additions & 12 deletions src/app/components/datatable/datatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,6 @@ export class DataTable implements AfterViewChecked,AfterViewInit,AfterContentIni

@Input() loadingIcon: string = 'fa-circle-o-notch';

@Input() enableLoader: boolean = true;

@Input() virtualScrollDelay: number = 500;

@Input() rowGroupExpandMode: string = 'multiple';
Expand Down Expand Up @@ -992,11 +990,7 @@ export class DataTable implements AfterViewChecked,AfterViewInit,AfterContentIni
}
}

handleDataChange() {
if(this.lazy && this.enableLoader) {
this.loading = false;
}

handleDataChange() {
if(this.paginator) {
this.updatePaginator();
}
Expand Down Expand Up @@ -2386,11 +2380,7 @@ export class DataTable implements AfterViewChecked,AfterViewInit,AfterContentIni
return !this.dataToRender||(this.dataToRender.length == 0);
}

createLazyLoadMetadata(): LazyLoadEvent {
if(this.enableLoader) {
this.loading = true;
}

createLazyLoadMetadata(): LazyLoadEvent {
return {
first: this.first,
rows: this.virtualScroll ? this.rows * 2 : this.rows,
Expand Down
11 changes: 1 addition & 10 deletions src/app/showcase/components/datatable/datatabledemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -1036,10 +1036,7 @@ <h3>Overlays in Cells</h3>

<h3>Loading Status</h3>
<p>DataTable has a loading property, when enabled a spinner icon is displayed to indicate data load.
An optional loadingIcon property can be passed in case you'd like a different loading icon. Note that
when lazy loading is enabled, DataTable handles loading status itself so there is no need to use
the loading property as it is built-in for lazy loading case. If you prefer to use your own loader in lazy mode, set
enableLoader property to false.</p>
An optional loadingIcon property can be passed in case you'd like a different loading icon.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-dataTable [value]="cars" [loading]="loading" loadingIcon="fa-spinner"&gt;
Expand Down Expand Up @@ -1438,12 +1435,6 @@ <h3>Properties</h3>
<td>fa-circle-o-notch</td>
<td>The icon to show while indicating data load is in progress.</td>
</tr>
<tr>
<td>enableLoader</td>
<td>boolean</td>
<td>true</td>
<td>Whether to use built-in loader in lazy mode.</td>
</tr>
<tr>
<td>rowTrackBy</td>
<td>Function</td>
Expand Down

0 comments on commit 1aacc33

Please sign in to comment.