Created
June 3, 2019 14:06
-
-
Save lesutton/c723252b84ba85e8f4a8d68438da3543 to your computer and use it in GitHub Desktop.
Datatables in Adaptive Forms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tableDefinition = "<div id='#guideContainer-rootPanel-panel-guidetextbox___guide-item' class='datatableContentContainer'><table id='jsonDataTable' class='display' width='100%'></table></div>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
var dtph = $("#guideContainer-rootPanel-panel-guidetextbox___guide-item"); | |
dtph.replaceWith(tableDefinition); | |
} catch (e) { | |
console.log("Error updating element: " + e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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