How to combine two tables? or interact with another subset of data

How to combine two tables? or interact with another subset of data

latinunitlatinunit Posts: 73Questions: 12Answers: 0

Link to test case: http://live.datatables.net/qigurada/1/
Description: Two data subsets recipient data and services data, recipients are subscribed to 1:n services

In my recipient array object I have recipient data and a key containing a list of services they are subscribed to, i.e.

let rcpObj = [
  {
    "id": "13251436",
    "cmOneID": "0",
    "email": "namesurname_uk@testemail.com",
    "name": "John G.",
    "jurisdiction": "SCPB - LON",
    "blackList": "0",
    "rm": "Domenica Zampatti",
    "lawfulBasis": "3",
    "subscriptions": ""
  },
  {
    "id": "13241506",
    "cmOneID": "298965407",
    "email": "jca62856@testemail.com",
    "name": "Michael S.",
    "jurisdiction": "SwissShared",
    "blackList": "0",
    "rm": "Domenica Zampatti",
    "lawfulBasis": "3",
    "subscriptions": "18474400,18404622"
  }];

let services = [
{"id":"18404622","name":"SVC38","label":"CH  > All Audiences >  Content > Newsletter"},
{"id":"28953520","name":"SVC61","label":"No Newsletter Subscriptions"},
{"id":"18474400","name":"SVC_DO_CH","label":"Double optin service CH (Swiss)"},
{"id":"29168770","name":"SVC63","label":"SFOS > Content > Newsletter"}
];

What I need now, is render the list of existing services across and then for each recipient, show which ones they are subscribed to, as you can see in my recipient obj I have the list of subscriptions Ids and in the services object the list of all subscriptions, which will be used to display the labels. I've not seen a similar example or use case in the documents, any support is welcome, this is sort of my current obstacle now,

Expected outcome:

This question has accepted answers - jump to:

«1

Answers

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Sounds like you want a data structure that looks like this:

      {
        "id": "13241506",
        "cmOneID": "298965407",
        "email": "jca62856@testemail.com",
        "name": "Michael S.",
        "jurisdiction": "SwissShared",
        "blackList": "0",
        "rm": "Domenica Zampatti",
        "lawfulBasis": "3",
        "subscriptions": "18474400,18404622",
        "services": ["Double optin service CH (Swiss)", "CH  > All Audiences >  Content > Newsletter"]
      }
    

    You can then use columns.render to display the array in the way you want.

    Likely the most efficient option would be to build a query of the data source that builds the rows the way you want. This may or may not be possible.

    Otherwise you will need to combine the two arrays into a structure like above. Probably would be better to do this at the server script. If using ajax you can use ajax.dataSrc to combine the data with your choice of Javascript loops.

    Another option is to leave the rcpObj array as is and change the services array to an object with the key being the id, for example:

    let services = {
      "18404622": {"name":"SVC38","label":"CH  > All Audiences >  Content > Newsletter"},
      "28953520": {"name":"SVC61","label":"No Newsletter Subscriptions"},
    }
    

    Then use columns.render to loop through all the subscriptions values to use as keys to pull the proper label(s) from services.

    You could display the service labels in child detail rows.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    Hi Thor,

    But that way, if I have 50k recipient objects, the subscriptions will have to be copied to each object? isnt that too redundant?

    I mean looking at it from a database perspective, thats copying the same data amogst 50 cells rather than referencing and making a link between the two.

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    edited December 2022

    isnt that too redundant?

    Yep. I was just giving options since I don't know your environment, etc. If a service ID can be assigned to multiple people then yes this might be redundant. If a service ID is tied to only one person then maybe its not redundant.

    EDIT: Note with this solution the services array would not be needed at the client. So maybe the redundancy would be ok. Its up to you to decide.

    referencing and making a link between the two.

    Then convert the services array to an object like I described. Otherwise you will need to loop through the array look for each subscription ID.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    Hi Thor, I am still trying to get my head around this, and I guess the best way is to tackle it in smaller chunks.

    1. Is it possible to loop services array of objects and display each object as a "custom" column? This is the first step.

    I need to display all* the objects in the services array as columns, given that I need to be able to subscribe recipients to services they are not subscribed to.

    For instance, this would be possible if can I dynamically inject new columns to datatables using one of its apis? i.e

    var myservice = [{"id":12345,"label":"Myservice1"}];
    

    and then loop for each item in myservice array then inject as column to

    $('#recipients').DataTable
    
  • latinunitlatinunit Posts: 73Questions: 12Answers: 0

    @allan it seems this is exactly what I need? is the API added to add new columns dinamically?

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    For instance, this would be possible if can I dynamically inject new columns to datatables using one of its apis?

    Datatables doesn't support this.

    One option is to determine the number of columns required before initializing Datatables. Build the columns in a variable then using a variable that is used for initialization. See this generic example to show what I mean:
    http://live.datatables.net/huyexejo/1/edit

    Then you would need to create the code for each services column to extract the appropriate data from the services array. Can be done but would be a bit complex.

    Maybe a better option is to use Child Detail Rows. This allows you to display data in the format you need using the format() function. This is freeform data without the restrictions Datatables imposes.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0

    @kthorngren and If I create the following structure data, would it be possible? basically create an object and append recipient and services as arrays of objects? would that allow me to create the custom columns based on the 2nd services array.

    {
      "data": [
        {
          "id": "13241356",
          "cmOneID": "298965407",
          "email": "jca62856@testemail.com",
          "name": "Testinder Inder",
          "jurisdiction": "SwissShared",
          "blackList": "0",
          "rm": "Domenica Zampatti",
          "lawfulBasis": "0",
          "subscriptions": "3218140"
        },
        {
          "id": "13251466",
          "cmOneID": "0",
          "email": "namesurname_uk@testemail.com",
          "name": "name & surname surname Test",
          "jurisdiction": "SCPB - LON",
          "blackList": "0",
          "rm": "Domenica Zampatti",
          "lawfulBasis": "3",
          "subscriptions": ""
        },
        {
          "id": "13251467",
          "cmOneID": "0",
          "email": "namesurname_uk@testemail.com",
          "name": "name Test surname",
          "jurisdiction": "SCPB - LON",
          "blackList": "0",
          "rm": "Domenica Zampatti",
          "lawfulBasis": "3",
          "subscriptions": ""
        },
        {
          "id": "13251316",
          "cmOneID": "0",
          "email": "namesurname_uk@testemail.com",
          "name": "name G",
          "jurisdiction": "SCPB - LON",
          "blackList": "0",
          "rm": "Adam Cavalier",
          "lawfulBasis": "3",
          "subscriptions": "6161413,3218141,16965220,15656200,3721"
        }
      ],
      "services": [
        {
          "id": "3721",
          "name": "newsletter",
          "label": "Newsletter"
        },
        {
          "id": "15656200",
          "name": "SVC35",
          "label": "Sustainability"
        },
        {
          "id": "3218140",
          "name": "SVC47",
          "label": "UK > Private Clients > Services"
        },
        {
          "id": "3218141",
          "name": "SVC40",
          "label": "UK Branded Dialogue"
        },
        {
          "id": "3218142",
          "name": "SVC25",
          "label": "UK > Private Clients > Content > Newsletter"
        },
        {
          "id": "16965220",
          "name": "SVC37",
          "label": "UK > DFM > Valuation Email"
        },
        {
          "id": "6161413",
          "name": "SVC92",
          "label": "US Branded Dialogue"
        }
      ]
    }
    
  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    I think my only option is to prepare the columns beforehand as is easier, given that I only need to display the firstname in the first column.

    http://live.datatables.net/qigurada/9/

        let columns= [
    {data: null, defaultContent: '', orderable: false, className: 'select-checkbox'},
    {data: 'id', title: 'id' },
    {data: 'cmOneID', title: 'cmOneID' },
    {data: 'email', title: 'Email' },
    {data: 'name', title: 'Recipient' },
    {data: 'jurisdiction', title: 'Jurisdiction' },                             
    {data: 'blackList',title:'Blacklist'},
    {data: 'rm', title: 'Manager' },
    {data: 'lawfulBasis', title: 'Consent'},
    {data:null,defaultContent:"3218143","title":"UK > Advisers > Services"},
    {data:null,defaultContent:"3721","title":"Newsletter"},
    {data:null,defaultContent:"15656200","title":"Sustainability"},
    {data:null,defaultContent:"3218140","title":"UK > Private Clients > Services"},
    {data:null,defaultContent:"3218141","title":"UK Branded Dialogue"},
    {data:null,defaultContent:"3218142","title":"UK > Private Clients > Content > Newsletter"},
    {data:null,defaultContent:"3218145","title":"UK > DFM > Content > Newsletter"},
    {data:null,defaultContent:"16965220","title":"UK > DFM > Valuation Email"},
    {data:null,defaultContent:"6161413","title":"US Branded Dialogue"}
    ];
    

    Is this more or less a good alternative @kthorngren ??

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    edited December 2022 Answer ✓

    Sorry, I misunderstood. I thought you only want to show the services the person is assigned to. This is a good alternative to chow all of them.

    You could use columns.render for the services column and if the person is assigned the service then display the service id or name and if not assigned then leave the cell empty.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0

    @kthorngren, so the idea is.

    Given that I have in my recipient object the services they are registered to, i need to show all* available services from my services object, which from the looks of it will become my column data, and in each cell for each row, i need to create a button which shows if the the recipient is subscribed to that service or not by matching the service ids.

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    That sounds like it will work nicely.

    Regarding the API to dynamically add / remove columns. My comment in the screenshot above hasn't stood the test of time! It hasn't been implemented and isn't yet on the cards. I would like to do that one day, but I've been working on other aspects of DataTables.

    The columns array needs to be dynamically generated at initialisation time if you don't have a fixed column structure. That could be done by looping over your services object for example.

    Allan

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    Hi @allan and @kthorngren

    I've configured my columns, now I need to create a logic to display a text if the data id matches the id inside the object so I can write "Subscribed" so here it is.

    if I have the following column, I am essentially configuring my column to display the recipient's subscriptions data which is rendered as following

    inside the subscription object, I have the ID of the particular service, I want to know compare the data values against this object's id value "id":"3218143" how can I achieve that?

    {"data":"subscriptions","id":"3218143","title":"UK > Advisers > Services",render: function (data,type,meta,row) {return data;}},
    
    {
      "id": "13241506",
      "cmOneID": "298965407",
      "email": "jca62856@testemail.com",
      "name": "Michael S.",
      "jurisdiction": "SwissShared",
      "blackList": "0",
      "rm": "Domenica Zampatti",
      "lawfulBasis": "3",
      "subscriptions": "3218140,3218140"
    }
    

    http://live.datatables.net/qigurada/10/edit

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Take a look at the columns.render docs.

    In your second column you have this:

            {data: null ,defaultContent:'',render: function (meta,row) {return meta.row;}},
    

    Take note of the order of the parameters in the columns.render docs. The first is the cell data not meta. Also meta is the last parameter. To use the meta parameter you need to include the others in proper order, for example:

            {data: null ,defaultContent:'',render: function (data, type, row, meta) {return meta.row;}},
    

    Now that column should have the row index. My guess is it is showing undefined.

    The same goes for the subscriptions column, you have meta and row in the wrong order.

    The columns.render row parameter contains the data for the full row. In the function you can access the id with row.id.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    Hi @kthorngren

    I need to be able to access the service column's defaultContent or id rather than the subscription's object id. from the screenshow below, I want to access the data highlighted in yellow.
    latest edit
    http://live.datatables.net/qigurada/12/edit

    from the below, how can I access the title of the column or the id. or the default content so that I can compare if the subscription data ids match the columns's service id or defaultcontent or, I want to return the title.

     {"data":"subscriptions",defaultContent:'3218143',"id":"3218143","title":"UK > Advisers > Services",render: function (data, type, row, meta) {return JSON.stringify(row.id);}},
    

    as row.id returns my recipient's id.

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    There isn't an API method to get the defaultContent for a cell I'm afraid. It might still be possible, but I'm not seeing where in your code you are attempting to work with those values. There isn't an event handler that is attempting to work with those values? Unless I'm missing something? Do you want it in your rendering function?

    Allan

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    Hi @allan,
    I think is slighly confusing given that I've used a workaround to get the outcome I want.

    So, the object which contains recipient subscription data is the following

    {
      "id": "13241506",
      "cmOneID": "298965407",
      "email": "jca62856@testemail.com",
      "name": "Michael S.",
      "jurisdiction": "SwissShared",
      "blackList": "0",
      "rm": "Domenica Zampatti",
      "lawfulBasis": "3",
      "subscriptions": "3218140,3218140"
    }
    

    And here is one of my pre-configured configured column(s) aka service(s) which has the service ID (3218143) that I need to match with the recipient subscriptions service ids array   "subscriptions": "3218140,3218140"

             {"data":"subscriptions",defaultContent:'3218143',"id":"3218143","title":"UK > Advisers > Services",render: function (data, type, row, meta) {return JSON.stringify(row.id);}},
    

    So currently, this return row.id is actually returning the id of the recipient object, obviously as the data key is subscriptions, however, I need to grab is my custom column id (3218143) so that I can compare it with the row.subscriptions data.

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    "id":"3218143"

    This won't be applied to the column data as Datatables doesn't have a id option for columns.

    One option might be what I suggested earlier:

    Another option is to leave the rcpObj array as is and change the services array to an object with the key being the id, for example:

    let services = {
      "18404622": {"name":"SVC38","label":"CH  > All Audiences >  Content > Newsletter"},
      "28953520": {"name":"SVC61","label":"No Newsletter Subscriptions"},
    }
    

    I'm not sure what exactly you need to check but you can then use the subscriptions array to access the object above by the id.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0

    Hi @kthorngren what I need is to compare if the recipient's subscriptions ids, match the column service id. so that I can return "Yes" or "Subscribed" to that columns service.

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    I think this is what you are after:
    http://live.datatables.net/qigurada/15/edit

    It sets the columns.data for each subscription column to the subscription ID. Sets columns.defaultContent to an empty string.

    initComplete is used to iterate all the rows. In the loop it gets all the subscriptions into a list and loops the list to set all the appropriate columns with Subscribed.

    Finally uses rows().invalidate() to have Datatables refresh its data cache with the updated data.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    This is amazing, I want to thank you for all your support, we are getting ever so close to the desired outlook.

    I've added the toggle buttons (checkbox) in turn of subscribed text, and I am trying to display the off buttons for those that are not, but doesnt seem to want to work, im trying to expand on your script.

    http://live.datatables.net/dalavuni/1/edit

    I then tried to add it in render but that seems to overwrite the subscriptions

    {"data":"3218143",defaultContent: '',"title":"UK &gt; Advisers &gt; Services",render: function (data, type, row, meta) {return '<input class="services" type="checkbox">';}},
    

     for ( i=0; i<subscriptions.length; i++ ) {
                    if(subscriptions[i].length>0)   {                  
                      data[ subscriptions[i] ] = '<input class="services" type="checkbox" checked>';
                    } else if(subscriptions[i].length<1){                   
                        data[ subscriptions[i] ] = '<input class="services" type="checkbox">';                  
                    }                
                  }
    
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Here is how I think I would be tempted to do it: http://live.datatables.net/dalavuni/3/edit . Use a rendering function to check what state the row's data is in and then return the result as needed.

    Allan

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    edited December 2022

    The if(subscriptions[i].length<1) will never be true because the loop won't be entered when it were true. Try moving the off position to columns.defaultContent.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0

    Thanks @allan @kthor

    I am trying now to create an array for all selected rows which list which checkboxes are checked and which are not. I got as far as having an array of selected rows ids using pluck, now I want for each selected row, an array/object of which checkedboxes are on/off. (the purpose for this is that, I need to process which subscriptions to register and which to deregister).

    Issues: I added a button to execute the function to return selected rows recipient ids and it removes the filters, how do i have a button below the filters? I think this is because in the table config I changed the dom value to Bfrtip, but if I use Pfrtip it shows the filters but not the button.

              dom: 'Bfrtip', 
                 //dom:'Pfrtip',
    

    http://live.datatables.net/zimerisa/2/edit

                    /****************TESTING ****************/
                            //var selectedRows = table.rows( { selected: true } ).data().toArray();
                          var selectedRows = table.rows( { selected: true } ).data().pluck( 'id' ).toArray();
                            console.log(selectedRows);
    
    
                          var cells = table.cells( ( this ).data()).toArray();
                          //console.log(cells);
                          
      var unchecked = [];  
      var checked = [];
    $("input[type=checkbox]:checked").each(function(){
      checked.push($(this).val());
    });
        
        $("input[type=checkbox]:not(:checked)").each(function(){
      unchecked.push($(this).val());
    });    
      console.log(checked)
      //console.log(unchecked)                      
                          
                          
                    /***************************************/
    
  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    I didn't see Allan's solution until now. Its a good one :smile:

    I think this is because in the table config I changed the dom value to Bfrtip, but if I use Pfrtip it shows the filters but not the button.

    Combine all the letters in the order you want displayed, dom: 'PBfrtip', for example.

    One option is to use rows().every() to loop through the selected rows. In the loop use row().node() to get the HTMl node of the row. Using jQuery you can loop through all the checked checkboxes within the node. For example:
    http://live.datatables.net/zimerisa/4/edit

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0

    @allan @kthorngren

    Im now intergating the script from the sandbox into my application and ran into some obstacle, given that I am programatically fetching the services then looping through them and pushing them to my colsDef array, it seems the function which renders the return content is causing some issues.

    function checkbox (id) {
      return function (data, type, row, meta) {
        if (! data) {
          return 0;
        }
        var subs = data.subscriptions.split(',');    
        if (subs.includes(id)) {
          return type === 'display'
            ? '<input class="services" value="'+data.id+'-'+id+'" type="checkbox" checked/>'
            : 1;
        }    
        return type === 'display'
          ? '<input class="services" value="'+data.id+'-'+id+'" type="checkbox"/>'
          : 1;
      };
    }
    
    jQuery( document ).ready(function() {         
        var colsDef = [
            {data: null, defaultContent:'', orderable: false, className: 'select-checkbox',title:'<input type="checkbox" id="select_all" class="" title="Select All" />'},
            {data: null ,defaultContent:'',render: function (data, type, row, meta) {return meta.row;}},
            {data: 'id', title: 'id' },
            {data: 'cmOneID', title: 'cmOneID' },
            {data: 'email', title: 'Email' },
            {data: 'name', title: 'Recipient' },
            {data: 'jurisdiction', title: 'Jurisdiction' },                             
            {data: 'blackList', title: ' Blacklist'},
            {data: 'rm', title: 'Manager' },
            {data: 'lawfulBasis', title: 'Consent'}
           ];   
    
    /** Query services and push to colsDef array ***/
            var servicesQuery = {
               "operation":"select", "schema":"nms:service",
               "startLine":0, "lineCount":999,
               "select":{
                  "node":[
                    {"expr":"@label"}, 
                    {"expr":"@id"}
                  ],
               },
               "where":{
                  "condition":[{"expr":"@id <> 0 AND @name NOT IN ('SVC_DO_CAZ','SVC_DO_SCH','SVC_DO_SFOs','SVC_DO_CH')"}]
               },
               "orderBy":{
                  "node":[{"expr":"@id"}]
               },   
            };
            
            $.post("/xtk/queryList.jssp", {queryDef:encodeURIComponent(JSON.stringify(servicesQuery))}, function(servicesRes) {
          
                      for (var key in servicesRes.data) {
                          colsDef.push({
                                           data:null,
                                           defaultContent: '',                                       
                                           "title": servicesRes.data[key].label,
                                           render: checkbox(servicesRes.data[key].id.toString())
                                          });                         
                                     }                               
            });
    
    
    
    console.log(colsDef)
    

    Here is the console log screenshot

    and here is the contents of the first service

    Here is the error message

    For some reason the service columns that are fetched dynamically are not being rendered, however, if I hardcode one service column for testing it renders fine.

    I added this from your last sample to redraw the table but doesnt work

    initComplete: function () {
      var api = this.api();
      api.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
    
      });
      api.rows().invalidate().draw();
    }
    
  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Its hard to say without actually seeing the problem and the response data. I would first check the XHR response in line 50 using the browser's network inspector. Next debug the for loop in line 52 and the checkbox() function.

    For help debugging please post a link to your page or a test case replicating the issue.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    Hi @kthorngren, the response is below, basically just the array of objects containing the id and the label of the services, I then iterate this array and create a new array with the structure used in our sandbox using the loop brlow, so Im pushing the new objects to the existing colsDef array, I can't share the webapp link as is only accessible through corporate vpn.

                      for (var key in servicesRes.data) {
                          colsDef.push({
                                           data:null,
                                           defaultContent: '',                                      
                                           "title": servicesRes.data[key].label,
                                           render: checkbox(servicesRes.data[key].id.toString())
                                          });                        
                                     }     
    

    **
    sample XHR RESPONSE servicesRes**

    {
      "data": [
        {
          "id": "3721",
          "label": "Newsletter",
          "_schema": "nms:service"
        },
        {
          "id": "3218140",
          "label": "UK > Private Clients > Services",
          "_schema": "nms:service"
        },
        {
          "id": "3218141",
          "label": "UK  Capital Branded Dialogue",
          "_schema": "nms:service"
        },
        {
          "id": "3218142",
          "label": "UK > Private Clients > Content > Newsletter",
          "_schema": "nms:service"
        },
        {
          "id": "3218143",
          "label": "UK > Financial Advisers > Services",
          "_schema": "nms:service"
        },
        {
          "id": "3218144",
          "label": "UK > Financial Advisers > Products > MPS",
          "_schema": "nms:service"
        }
      ],
      "needPagination": false
    }
    

    Here is the colsDef array with the above objects that were pushed, I am not sure at which point is the rendering of the buttons takes place? it seems that this is where the problem lies render: checkbox(servicesRes.data[key].id.toString())

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    edited December 2022

    Its difficult to debug code snippets. I would use the browser’s debugger to set breakpoints at the areas I suggested above. Trace the code to see what is happening.

    Kevin

  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    Okey I changed the logic and is working now, seems like by the time the table was taking the columns into consideration before the render was happening, so I changed it like below and is working now.

    I iterated over the services and added a new key to the object containing the render function and then merge the services with the colsDef and worked fine.

    http://live.datatables.net/zimerisa/8/edit

            //,render: function (data, type, row, meta) {return "<input type='checkbox'>"
            let services = [
            {"data":null,"defaultContent": '',"title":"UK &gt; Advisers &gt; Services", "id":"321814"},
            {"data":null,"defaultContent": '',"title":"Newsletter", "id":"3721"},
            {data:null,defaultContent: '',"title":"Sustainability","id":"15656200"},
            {data:null,defaultContent: '',"title":"UK &gt; Private Clients &gt; Services", "id":"3218140"},
            {data:null,defaultContent: '',"title":"UK Branded Dialogue", "id":"3218141"},
            {data:null,defaultContent: '',"title":"UK &gt; Private Clients &gt; Content &gt; Newsletter", "id":"3218142"},
            {data:null,defaultContent: '',"title":"UK &gt; DFM &gt; Content &gt; Newsletter", "id":"3218145"},
            {data:null,defaultContent: '',"title":"UK &gt; DFM &gt; Valuation Email","id":"16965220"},
            {data:null,defaultContent: '',"title":"US Branded Dialogue", "id":"6161413"}
            ];
        
        
      for (let i = 0; i < services.length; i++) {
     services[i].render = checkbox(services[i].id);
    }  
        //console.log(services)
        
           const columns = [...colsDef, ...services];
    
  • latinunitlatinunit Posts: 73Questions: 12Answers: 0
    edited December 2022

    :smiley: happy new year thanks for all your support, helped me alot, i shall make a donation soon to datatables.

Sign In or Register to comment.