Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit cf0ef60

Browse files
committed
Improve doc #218
1 parent 71c3da2 commit cf0ef60

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

demo/advanced/serverSideProcessing.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ <h1><i class="fa fa-play"></i>&nbsp;Server side processing</h1>
3636
<li>
3737
By default, <code>angular-datatables</code> set the <a href="http://datatables.net/reference/option/ajax.dataSrc"><code>AjaxDataProp</code></a> to <code>''</code>. So you need to provide the <code>AjaxDataProp</code> with either <code>.withDataProp('data')</code> or specifying the option <code>dataSrc</code> in the <code>ajax</code> option.
3838
</li>
39+
<li>
40+
If your server takes a while to process the data, I advise you set the attribute
41+
<a href="https://datatables.net/reference/option/processing"><code>processing</code></a> to <code>true</code>.
42+
This will display a message that warn the user that the table is processing instead of having a
43+
"freezing-like" table.
44+
</li>
3945
</ul>
4046
</div>
4147
<p class="text-warning">
@@ -74,6 +80,7 @@ <h1><i class="fa fa-play"></i>&nbsp;Server side processing</h1>
7480
})
7581
// or here
7682
.withDataProp('data')
83+
.withOption('processing', true)
7784
.withOption('serverSide', true)
7885
.withPaginationType('full_numbers');
7986
vm.dtColumns = [

demo/advanced/serverSideProcessing.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function ServerSideProcessingCtrl(DTOptionsBuilder, DTColumnBuilder) {
66
var vm = this;
77
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
88
.withPaginationType('full_numbers');
9-
// vm.dtOptions = DTOptionsBuilder.newOptions()
9+
//vm.dtOptions = DTOptionsBuilder.newOptions()
1010
// .withOption('ajax', {
1111
// // Either you specify the AjaxDataProp here
1212
// // dataSrc: 'data',
@@ -15,6 +15,7 @@ function ServerSideProcessingCtrl(DTOptionsBuilder, DTColumnBuilder) {
1515
// })
1616
// // or here
1717
// .withDataProp('data')
18+
// .withOption('processing', true)
1819
// .withOption('serverSide', true)
1920
// .withPaginationType('full_numbers');
2021
vm.dtColumns = [

demo/basic/overrideLoadingTpl.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
<h1><i class="fa fa-play"></i>&nbsp;Override <code>Loading</code> template</h1>
44
</header>
55
<section class="article-content">
6+
<p>
7+
There are two loading with angular-datatables:
8+
</p>
9+
<ul>
10+
<li>
11+
One comes from this module. It is displayed before the table is rendered. This loading has been added because
12+
angular-datables offers the possibility to fetch the data and options with promises. So before rendering the
13+
table, the promises need to be resoved, thus adding a loading message to let users know that something is
14+
processing.
15+
</li>
16+
<li>
17+
The other comes from DataTables. The message <code>Loading</code> is displayed inside the Table while fetching
18+
the data from the server.
19+
</li>
20+
</ul>
621
<p>
722
When loading data, the angular module will display by default <code>&lt;h3 class="dt-loading"&gt;Loading...&lt;/h3&gt;</code>.
823
</p>

0 commit comments

Comments
 (0)