How to add row design base on condition?

How to add row design base on condition?

jer040506jer040506 Posts: 5Questions: 3Answers: 0
edited November 2019 in Free community support
<style>
.red {
  background-color: red !important;
  }
</style>

$(function() {
   var table = $('#item').DataTable({
    processing: false,
    serverSide: true,
    ajax: '{!! route('admin.get.item') !!}',
    columns: [
      { data: 'item_name', name: 'item_name' },
        { data: 'item_quantity',
                          ***if item quantity is less than 5****
          if( row.item_quantity === '5')
          {
            $(row).addClass('red');
          } 
           else
          {

           }
        },
     ]
   });
  });

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.