Answers.Body: <p>There lots of screen that uses datatable to retrieve list of results which do not support any hooks to manipulate results or add additional clause or columns. We have altered the ajax request post/get data using jquery to send filters. In some cases it works, like in your case it may work if you want to filter it using campaign type. Here is a small snippet that i would call on the campaign dashboard page</p>
  
  <pre><code>{literal}
  &lt;script type="text/javascript"&gt;
  CRM.$(function($) {
    $(document).ajaxSend(function(event, jqxhr, settings) {
      let url = decodeURIComponent(settings.url);
      if (url.indexOf('datatable/called/url') != -1
        &amp;&amp; url.indexOf('[otherparameter]') != -1
      ) {
        if (!$('#campaign_type_id').val()) {
          settings.data = settings.url + '&amp;searchCriteria=campaign_type_id&amp;campaign_type_id=' + '1,2,3';
        }
      }
    });
  });
  &lt;/script&gt;
  {/literal}
  </code></pre>
  
  <p>The other alternative method is support hooks like selectWhereClause or rewrite whole logic to use api so that it can altered using hook a and submitting PR.</p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-03T07:48:12.207Z
Answers.Text: Thanks Pradeep. I believe it would be worthwhile to add a bit to the Developer Guide explaining how these admin pages can be influenced?
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-30T18:30:57.823Z
Answers.LastActivityDate: 2020-01-30T18:30:57.823Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Unfortunately the searchColumns hook is not called by this form. It is a DataTable, but trying to use the stuff that is documented in the DataTable API (like .rows() or rowCreated do not seem to work either?</p>
  
  <p>How can I manipulate a row from this dataTable and who would like to have a go at adding a dataTables chapter to the Developer Guide (or is it already there and am I missing it?)</p>
  
Tags: <search-results><datatables>
Title: On the Campaign dashboard I would like to prevent one specific type from being listed
ThreadText: # On the Campaign dashboard I would like to prevent one specific type from being listed
  
  (Asked by: username_0 on 2020-01-30)
  
  Unfortunately the searchColumns hook is not called by this form. It is a DataTable, but trying to use the stuff that is documented in the DataTable API (like .rows() or rowCreated do not seem to work either?
  
  How can I manipulate a row from this dataTable and who would like to have a go at adding a dataTables chapter to the Developer Guide (or is it already there and am I missing it?)
  
  **Tags:** search-results, datatables
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-01-30. Score: 1
  
  There lots of screen that uses datatable to retrieve list of results which do not support any hooks to manipulate results or add additional clause or columns. We have altered the ajax request post/get data using jquery to send filters. In some cases it works, like in your case it may work if you want to filter it using campaign type. Here is a small snippet that i would call on the campaign dashboard page
  {literal}
  
  {/literal}
  
  The other alternative method is support hooks like selectWhereClause or rewrite whole logic to use api so that it can altered using hook a and submitting PR.
  HTH
  Pradeep
  
  > **Comments:**
  > **username_0**: Thanks Pradeep. I believe it would be worthwhile to add a bit to the Developer Guide explaining how these admin pages can be influenced?  
  
  ---
  
  