Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Datatables in Adaptive Forms
var tableDefinition = "<div id='#guideContainer-rootPanel-panel-guidetextbox___guide-item' class='datatableContentContainer'><table id='jsonDataTable' class='display' width='100%'></table></div>";
try {
var dtph = $("#guideContainer-rootPanel-panel-guidetextbox___guide-item");
dtph.replaceWith(tableDefinition);
} catch (e) {
console.log("Error updating element: " + e);
}
var table = $('#jsonDataTable').DataTable({
data: JSON.parse(jsonData.value),
destroy: true,
columns: [
{title: "Name"},
{title: "Position"},
{title: "Office"},
{title: "Extn."},
{title: "Start date"},
{title: "Salary"}
]
});
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.