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

Commit 33e3648

Browse files
committed
Update API doc for language #179
1 parent da3de19 commit 33e3648

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

demo/api/apiOptionsBuilder.html

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,22 @@ <h3><code>DTOptionsBuilder</code></h3>
219219
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
220220
.withPaginationType('full_numbers');
221221
}
222+
</div>
223+
</td>
224+
</tr>
225+
<tr>
226+
<td><code>DTOptions</code></td>
227+
<td><code>withLanguageSource(oLanguage)</code></td>
228+
<td>
229+
<p>Set the language source of the datatables. If not defined, it uses the default language set by datables, ie english.</p>
230+
<p>You can find the list of languages in the <a href="https://datatables.net/plug-ins/i18n/">DataTable official's documentation</a>.</p>
231+
<div hljs language="js">
232+
angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
233+
function MyCtrl(DTOptionsBuilder) {
234+
var vm = this;
235+
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
236+
.withLanguageSource('/path/to/language');
237+
}
222238
</div>
223239
</td>
224240
</tr>
@@ -233,7 +249,44 @@ <h3><code>DTOptionsBuilder</code></h3>
233249
var vm = this;
234250
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
235251
.withLanguage({
236-
sUrl: '/path/to/language'
252+
"sEmptyTable": "No data available in table",
253+
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
254+
"sInfoEmpty": "Showing 0 to 0 of 0 entries",
255+
"sInfoFiltered": "(filtered from _MAX_ total entries)",
256+
"sInfoPostFix": "",
257+
"sInfoThousands": ",",
258+
"sLengthMenu": "Show _MENU_ entries",
259+
"sLoadingRecords": "Loading...",
260+
"sProcessing": "Processing...",
261+
"sSearch": "Search:",
262+
"sZeroRecords": "No matching records found",
263+
"oPaginate": {
264+
"sFirst": "First",
265+
"sLast": "Last",
266+
"sNext": "Next",
267+
"sPrevious": "Previous"
268+
},
269+
"oAria": {
270+
"sSortAscending": ": activate to sort column ascending",
271+
"sSortDescending": ": activate to sort column descending"
272+
}
273+
});
274+
}
275+
</div>
276+
<p>
277+
It is not mandatory to specify every keywords. For example, if you just need to override the keywords
278+
<code>oPaginate.sNext</code> and <code>oPaginate.sPrevious</code>:
279+
</p>
280+
<div hljs language="js">
281+
angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
282+
function MyCtrl(DTOptionsBuilder) {
283+
var vm = this;
284+
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
285+
.withLanguage({
286+
"oPaginate": {
287+
"sNext": "&raquo;",
288+
"sPrevious": "&laquo;"
289+
}
237290
});
238291
}
239292
</div>

0 commit comments

Comments
 (0)