title: how to make column visibilty true on select option in datatable
body: <p>when i select generated(Pending_Flag == 1),compelete(Pending_Flag == 2) option from drop down(ViewPkr) visibility for column 15 should be true on click of a button"#GoBtn" 
  on other hand on selection of pending(Pending_Flag == 0) option visibility for column 15 should be fasle on click of a button"#GoBtn"</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//button code 
  $(document).ready(function() {
    $("#GoBtn").click(function() {
  
      Pending_Flag = $("#ViewPkr option:selected").val();
  
      if (Pending_Flag == 1) {
        StatusChecker = 1;
      }
      GetDocList(SelectedRTA, Pending_Flag, Pending_Flag);
      if (Pending_Flag == 0) {
  
      }
      if (Pending_Flag == 1) {
  
        DT_DocList_Table.columns([15]).visible(true);
      }
      if (Pending_Flag == 2) {
  
        DT_DocList_Table.columns([15]).visible(true);
      }
    });
  });
  // datatable structure
  function CreateDatatable(ScreenStage) {
    $("#DocTableDiv").empty();
    var str = '&lt;table class="display table table-hover table-striped dataTable no-footer" id="DocListTable" width="100%"&gt;&lt;/table&gt;';
    $("#DocTableDiv").append(str);
  
    DT_DocList_Table = $("#DocListTable").dataTable({
      "data": ListJsonData,
      //"aaSorting": [[1, "desc"]],
      "order": [
        [1, "desc"]
      ],
      "sDom": 'CTfr&lt;"clear"&gt;tip',
      //        "sDom": 'lC&lt;"H"Tfr&gt;t&lt;"F"p&gt;',
      "dom": 'CT&lt;"clear"&gt;t&lt;"bottom"p&gt;',
      "language": {
        "sSearch": ""
      },
      "columnDefs": [
  
        {
          "targets": 14 "title": "sampledata",
  
        }, {
          "targets": 15,
          "title": "Redo",
          "render": function(data) {
            var returnHTML1 = CreateButton(data);
            return returnHTML1;
          },
          "sortable": true,
          "className": "col-xs-1"
        }
  
  
        , {
          "visible": false,
          "targets": [15]
        }
      ]
    });
    $('.dataTables_filter input[type="search"]').attr('placeholder', 'Search')
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select class="selectpicker" data-live-search="true" data-size="3" id="ViewPkr"&gt;
    &lt;option value="0"&gt;Pending&lt;/option&gt;
    &lt;option value="1"&gt;Generated&lt;/option&gt;
    &lt;option value="2"&gt;Completed&lt;/option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>