Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Template for advance view json response
// Each row as an object
"advancedView": {
"allRows": true,
"dataContent": {
"aaData": [
{
"checkbox": "<div class=\"form-checkbox form-checkbox--single\"><input data-action=\"select.row\" type=\"checkbox\" id=\"select-{{@index}}\" value=\"{{@index}}\" /><label for=\"select-{{@index}}\"><span class=\"aria--visible\">{{this.id}}</span></label></div>",
"id": "<a class=\"inline-link\" data-link=\"row\" href=\"http://link-to-subscription-details.html\">{{this.id}}</a>",
"name" : "{{this.name}}",
"product" : "{{this.product}}",
"device" : "{{this.device}}",
"status" : "<span class=\"status-icon--error\">{{this.status}}</span>"
},
{
"checkbox": "<div class=\"form-checkbox form-checkbox--single\"><input data-action=\"select.row\" type=\"checkbox\" id=\"select-{{@index}}\" value=\"{{@index}}\" /><label for=\"select-{{@index}}\"><span class=\"aria--visible\">{{this.id}}</span></label></div>",
"id": "<a class=\"inline-link\" data-link=\"row\" href=\"http://link-to-subscription-details.html\">{{this.id}}</a>",
"name" : "{{this.name}}",
"product" : "{{this.product}}",
"device" : "{{this.device}}",
"status" : "<span class=\"status-icon--error\">{{this.status}}</span>"
}
// More rows ...
],
"aoColumns": [
{ "sTitle": "", "mData": "checkbox" },
{ "sTitle": "ID", "mData": "id" },
{ "sTitle": "Name", "mData": "name" },
{ "sTitle": "Product", "mData": "product" },
{ "sTitle": "Device", "mData": "device" },
{ "sTitle": "Status", "mData": "status" }
]
}
}
// Each row as an array
[
"<div class=\"form-checkbox form-checkbox--single\"><input data-action=\"select.row\" type=\"checkbox\" id=\"select-{{@index}}\" value=\"{{@index}}\" /><label for=\"select-{{@index}}\"><span class=\"aria--visible\">{{this.id}}</span></label></div>",
"<a class=\"inline-link\" data-link=\"row\" href=\"http://link-to-subscription-details.html\">{{this.id}}</a>",
"{{this.name}}",
"{{this.product}}",
"{{this.device}}",
"<span class=\"status-icon--error\">{{this.status}}</span>"
]
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.