Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- getItems();
- });
- function getItems() {
- $.ajax({
- async: true,
- url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('Global')/items?$filter=Title eq Domain",
- method: "GET",
- headers: {
- "accept": "application/json;odata=verbose",
- "content-type": "application/json;odata=verbose"
- },
- success: function(data) {
- data = data.d.results;
- console.log(data);
- $.each(data, function(index, value) {
- if (value.Title == null) {
- value.Title = "";}
- else{
- value.Title = value.Title ;}
- if (value.Grouped_x0020_OPUs == null) {
- value.Grouped_x0020_OPUs = "";}
- else{
- value.Grouped_x0020_OPUs = value.Grouped_x0020_OPUs;}
- if (value.Phase == null) {
- value.Phase = "";}
- else{
- value.Phase = value.Phase ;}
- if (value.Stage == null) {
- value.Stage = "";}
- else{
- value.Stage = value.Stage ;}
- var html = "<tr><td>" + value.Title + "</td><td>" + value.Grouped_x0020_OPUs + "</td><td>" + value.Phase + "</td><td>" + value.Stage + "</td></tr>";
- $('.table tbody').append(html);
- });
- table = $('#table_id').DataTable();
- },
- error: function(error) {
- console.log(JSON.stringify(error));
- }
- })
- }
Add Comment
Please, Sign In to add comment