En Jquery Datatable, intento agregar una clase llamada "control" en columnas específicas, pero parece que no funciona. No veo ningún error.
Estoy seleccionando columnas usando el nombre de la clase (todos) y luego tratando de agregar otro "control" de clase. Por favor, vea el código a continuación,
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: "Name", data: "Name" className: "all" }, { title: "Age", data: "Age" }, { title: "Serial Number", data: "Serial" }, { title: "Description", data: "Descritption", className: "all" }, { title: "Errors", data: "Notes", className: "all" } ], 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; };Cualquier sugerencia/dirección será muy apreciada.