jeudi 11 mai 2023

jquery checkbox select and alert popup [duplicate]

I want to show the row specifically when the checkbox corresponding to it is selected

//checkbox
'columnDefs': [{
  'targets': 0,
  'checkboxes': {
    'selectRow': true
  },
  'render': function(data, type, row, meta) {
    data = '<input type="checkbox" class="dt-checkboxes">'
    if (row[3] === 'London') {
      data = JSON.stringify(data);
      return type === 'display' && data.length > 120 ? data.substr(0, 120) + '…' : data;
      // return JSON.stringify(data);
    }
  },
  'createdCell': function(td, cellData, rowData, row, col) {
    if (rowData[3] === 'London') {
      this.api().cell(td).checkboxes.disable();
    }
  }
}],
//checkbox end
columns: [
    {
      title: 'Select',
      data: 'select',
      "width": "12%"
    },

    {
      title: 'Date Time',
      data: 'dateTime',
      "width": "12%"
    },
    {
      title: 'Transaction Id',
      data: 'transactionId',
      "width": "12%"
    },
    {
      title: 'Service Name',
      data: 'serviceName',
      "width": "12%"
    },
    {
      title: 'Status',
      data: 'serviceName',
      "width": "12%"
    },
    {
      title: 'Request',
      data: 'request',
      "width": "22%"
    },
    {
      title: 'Response',
      data: 'response',
      "width": "42%",
      render: function(data, type) {
        data = JSON.stringify(data);
        return type === 'display' && data.length > 120 ? data.substr(0, 120) + '…' : data;
        // return JSON.stringify(data);
      }
    }
  ],

  "language": {
    "emptyTable": "Exception details not found"
  }, select: {
    style: 'os',
    selector: 'td:first-child'
  }

});



Aucun commentaire:

Enregistrer un commentaire