title: Jquery Datatable - dynamically adding class to specific columns
body: <p>In Jquery Datatable, I am trying to add a class named &quot;control&quot; in specific columns but it seems not working. I do not see any errors.</p>
  <p>I am selecting columns by using class name (all) and then trying to add another class &quot;control&quot;. Please see the code below,</p>
  <pre><code>public static CreateTableView(tableId: string) {
      let dataTable = $(tableId).DataTable({
          deferRender: true,
          scrollY: '200px',
          scrollX: false,
          scrollCollapse: true,
          searching: false,
          paging: false,
          info: false,
          columns: [
              { title: &quot;Name&quot;, data: &quot;Name&quot; className: &quot;all&quot; },
              { title: &quot;Age&quot;, data: &quot;Age&quot; },
              { title: &quot;Serial Number&quot;, data: &quot;Serial&quot; },
              { title: &quot;Description&quot;, data: &quot;Descritption&quot;, className: &quot;all&quot; },                         
              { title: &quot;Errors&quot;, data: &quot;Notes&quot;, className: &quot;all&quot; }                
          ],
          responsive: {
              details: {
                  type: 'none',
                  target: '.btn-link',
                  display: GetDetailsDialogDisplay(tableId),
                  renderer: $.fn.dataTable.Responsive.renderer.tableAll({
                      tableClass: 'table'
                  })
              }
          },
          order: [1, 'asc'],
          select: {
              style: 'single',
              selector: 'td .btn-link',
              className: 'selected bg-selected-row'
          }
      });
  
  
      $(tableId).off('click', '.btn-link').on('click', '.btn-link', function () {
  
          dataTable.columns('.all').to$().addClass('control');
      });
  
      return dataTable;
  }; 
  </code></pre>
  <p>Any suggestion / direction will be greatly appreciated.</p>