Skip to content

Instantly share code, notes, and snippets.

@lesutton
Created June 3, 2019 14:06
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 lesutton/c723252b84ba85e8f4a8d68438da3543 to your computer and use it in GitHub Desktop.
Save lesutton/c723252b84ba85e8f4a8d68438da3543 to your computer and use it in GitHub Desktop.
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