title: Kendo ui grid - filter with ajax post
body: <p>I´m trying to filter my datasource but using a ajax post, and the reason is, i have a condition on main <strong>main</strong> GET on my server side which does this:</p>
  
  <pre><code>WHERE idPai IS NULL OR idPai = 0
  </code></pre>
  
  <p>Now what i want is to filter the datsource but <strong>without</strong> that condition on my server side, so first what i have done was:</p>
  
  <pre><code>       var value = $("#inputPastaFiltro").val();
  
          $.ajax({
          type: 'POST',
          url: "basedados.php",
          data: {dataFilter:value},
          dataType: "json",
          success: function(result) 
          {
             $('#gridBaseDados').data('kendoGrid').dataSource = new kendo.data.DataSource({ data: result.data[0] }).query({
              filter:{
                logic:"or",
                filters:[
                  {field:"nome", operator:"contains",value:result.data[0].nome}]  
               }
            });
          },
  </code></pre>
  
  <p>On the server side, i have create a:</p>
  
  <pre><code>else if($_POST['dataFilter'])
  </code></pre>
  
  <p>with the same GET i have but without the condition i have wrote above, this way(i think) it searches for everything, but the rest of the logic is not correct has you already realized. If i do just like this:</p>
  
  <pre><code>var value = $("#inputPastaFiltro").val();
  dataSource.query({
                  filter:{
                    logic:"or",
                    filters:[
                      {field:"nome", operator:"contains",value:value}]  
                   }
                });
  </code></pre>
  
  <p>it works very well, and it also does that dynamic search of refreshing the grid as soon as you insert the words in the input(which is great!)...but it is based on my MAIN GET which has that condition.</p>
  
  <p>Can anyone give me some help?, sorry for the bad english.</p>
  
  <p>Regards.  </p>