Skip to content

Instantly share code, notes, and snippets.

@woeldiche
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woeldiche/209c9fdd209d045cf0d9 to your computer and use it in GitHub Desktop.
Save woeldiche/209c9fdd209d045cf0d9 to your computer and use it in GitHub Desktop.
TN.config.table = TN.config.table || {};
TN.config.table.data = TN.config.table.data || {};
TN.config.table.data['example-table'] = {
serverside: false,
pipeline: 200,
ajaxurl: "src/data/my-subscriptions.json",
order: [1, 'asc'],
pagingType: 'simple_numbers',
processing: true,
language: {
lengthMenu: 'Display _MENU_ records',
paginate: {
first: 'First',
last: 'Last',
next: 'Next',
previous: 'Previous'
}
},
info: false,
columns: [
{
"name": "",
"data": "checkbox",
"orderable": false,
"class": "col--compact form-checkbox form-checkbox--single",
"render": function (data, type, row) {
return '<input data-action="select.row" type="checkbox" id="select-' + row.Identifier + '" name="' + row.Identifier + '" /><label for="select-' + row.Identifier + '"><span class="aria--visible">' + row.Identifier + '</span></label>';
}
},
{
"name": "Identifier",
"data": "Identifier",
"render": function (data, type, row) {
if (type === 'display') {
return '<p>' + row.Identifier + '</p><span class="text--small">' + row.Name + '</span>';
} else {
return data;
}
}
},
{ "name": "Name", "data": "Name", "visible": false },
{ "name": "Product", "data": "Product" },
{ "name": "Device model", "data": "Device model" },
{ "name": "Status", "data": "Status" }
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment