title: Inline if statement inside datatable
body: <p>I am not sure whether the question is asked before. but i couldnt find it. Thats the reason i am asking now. </p>
  
  <p>I have to use more datatables. so i am writing a common function to call it again and again by passing parameters. For that common code, i have to use inline if statement to add column widths, here i attached my code. someone help me to insert the inline condition inside it. </p>
  
  <pre><code>function common_datatable(file_ajax, module_name, btns_list, widths, view_btn) {            
    return $('#'+module_name+'_table').DataTable({ 
      "processing": true,
      "serverSide": true,
      "ajax": file_ajax, 
      "bLengthChange": false, "bAutoWidth": false , "sScrollX": "100%", 
      aoColumns : [
          (widths[0] !=0) ? '{ "sWidth": "1%" }' : '',            
          { "sWidth": "30%" },
          { "sWidth": "30%"},
          { "sWidth": "9%"}           
  
      ],  orderCellsTop: true,
      "scrollX": true,
      "order": [   [1, "asc"]  ], 
      "columns": [{"orderable": false}, null, null,  null, null, null ]
    });       
  }
  </code></pre>
  
  <p>The above code i passed array of width's through the width parameter, this is the code i am using, </p>
  
  <pre><code>(width[0] !=0) ? '{ "sWidth": "1%" }' : '',
  </code></pre>
  
  <p>but its not working inside it. </p>