Skip to content

Commit 7ac5f9b

Browse files
authored
Demonstrate how to avoid alert on missing values
If the api omits a value, Datatables complains. If you specify a default value for missing values Datatables will use that and not show an alert.
1 parent a20dbb4 commit 7ac5f9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

example/albums/templates/albums/albums.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h4 class="bg-primary text-white p-2" style="margin: 15px;">Minimal example with
6767
{"data": "rank", "searchable": false},
6868
// Use dot notation to reference nested serializers.
6969
// This data: could alternatively be displayed with the serializer's ReadOnlyField as well, as seen in the minimal example.
70-
{"data": "artist.name", "name": "artist.name"},
70+
{"data": "artist.name", "name": "artist.name", defaultContent: "-"},
7171
{"data": "name"},
7272
{"data": "year"},
7373
{"data": "genres", "name": "genres.name", "sortable": false},

0 commit comments

Comments
 (0)