Skip to content

Instantly share code, notes, and snippets.

@woeldiche woeldiche/tn.config.js
Last active Aug 29, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.