title: filtering table results using ajax
body: <p>I'm working on a php online shop website using codeigniter framework and i want to be able to filter my table results using checkboxes with ajax  <br/> </p>
  
  <p><strong>view:</strong>  </p>
  
  <pre><code>&lt;input type="checkbox" name="brand" value="acer"&gt;  
  
  
  &lt;input type="checkbox" name="brand" value="lenovo"&gt;    
  
  &lt;input type="checkbox" name="pret" value="1000"&gt;   
  
  
  
   &lt;table&gt;
          &lt;tbody&gt;
          &lt;?php foreach ($laptops_toate as $laptops_all) { ?&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;img src="http://localhost:82/ci/images/emag/&lt;?php echo $laptops_all-&gt;file ?&gt;"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;p&gt;Laptop &lt;?php echo $laptops_all-&gt;brand ?&gt; &lt;/p&gt;
                  &lt;/td&gt;
  
  
              &lt;/tr&gt;
          &lt;?php } ?&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;  
  </code></pre>
  
  <p><strong>Controller:</strong>  </p>
  
  <pre><code> public function laptops()
  {
  
      $filter = array(
          'pret' =&gt; $this-&gt;input-&gt;get('pret'),
          'brand' =&gt;$this-&gt;input-&gt;get('brand')
      );
  
      $data['laptops_toate'] = $this-&gt;emag_model-&gt;laptops_toate_grid($filter);
  
      $this-&gt;renders('emag/laptops', $data);
  }  
  </code></pre>
  
  <p><strong>model:</strong>  </p>
  
  <pre><code> public function laptops_toate_grid($filter = null){
      $this-&gt;db-&gt;select('*')
               -&gt;from('laptop_notebook');
     // $query = $this-&gt;db-&gt;get('laptop_notebook')-&gt;result();
     // return $query;
      if($filter['brand']){
          $this-&gt;db-&gt;where('brand', $filter['brand']);
      }
      if($filter['pret']){
          $this-&gt;db-&gt;where('pret', $filter['pret']);
      }
      $query = $this-&gt;db-&gt;get()-&gt;result();
  
      return $query;
  
  }
  </code></pre>
  
  <p>The problem is now at the ajax code, i don't know how to send the data filter to the server in order to receive the success function.</p>