Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
hide row on a datatable where the content is null in jquery

This is my ajax datatable. Now I can get the values on data table, and assigned the value is null when there isn't any matching condition. But What I need is, Have to hide the rows where there isn't any data or null value. If I remove the else condition getting an error as "requesting unknown parameter on column 0 row1..."

$('#retail-modal-retail-price-history').DataTable({
   data: record.retail_history,  
   destroy: true,
   searching: false,
   ordering: false,
   dom: '<<"row"<"col">>t<"row"<"col">>>',
   columns: [     
     {
         data: "price",
         'render': function (data, type, row, meta){
            if(row.TYPE==='re'){               
               return data/100;
              } 
              else
              return null;              
         } 
      
      },
      { 
         data: "scheduled_from",
         'render': function (data, type, row, meta){
            if(row.TYPE==='re'){
               
               return data;
              }   
              else
              return null;                
         }
      
      
      },
      ],

    
});

enter image description here

Want to hide the row which is coming at last. I can be able to achieve it by simply calling the below function.

$('#retail-modal-retail-price-history tr').each(function() {
   if ($(this).find('td:empty').length) $(this).remove();
});

But I understand, this is not a good solution. If there are any optimized way to do it

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!