Note that there are some explanatory texts on larger screens.

plurals
  1. POCakePHP: Sorting multiple HTML tables at once
    text
    copied!<p>I've joined a screenshot showing the multiple tables. I would like the paginator to work with multiple "shown" tables although they are all originating from the same query. Note that the 'Id' column is one of many columns.</p> <pre><code> var $paginate = array( 'limit' =&gt; 1000); function index() { $this-&gt;Immeuble-&gt;recursive = 1; $this-&gt;Immeuble-&gt;contain('Agence'); $this-&gt;set('results', $this-&gt;paginate()); $agences = $this-&gt;Immeuble-&gt;find('count', array('fields' =&gt; 'DISTINCT Agence.Nom')); $this-&gt;set('agences',$agences); $ii = 0; $records = $this-&gt;Immeuble-&gt;find("all",array('fields'=&gt;'Immeuble.id,Immeuble.image,Immeuble.description,Immeuble.start_date,Immeuble.end_date$ $this-&gt;set('records',$records); } </code></pre> <p>Here my paginator part in my view:</p> <pre><code>&lt;tr&gt; &lt;th&gt;&lt;?php echo $this-&gt;Paginator-&gt;sort('Id','id'); ?&gt;&lt;/th&gt; &lt;th&gt;&lt;?php echo $this-&gt;Paginator-&gt;sort('description');?&gt;&lt;/th&gt; &lt;th&gt;&lt;?php echo $this-&gt;Paginator-&gt;sort('start_date');?&gt;&lt;/th&gt; &lt;th&gt;&lt;?php echo $this-&gt;Paginator-&gt;sort('end_date');?&gt;&lt;/th&gt; &lt;th&gt;&lt;?php echo $this-&gt;Paginator-&gt;sort('image');?&gt;&lt;/th&gt; &lt;th&gt;&lt;?php echo $this-&gt;Paginator-&gt;sort('ordre');?&gt;&lt;/th&gt; &lt;th&gt;&lt;?php echo $this-&gt;Paginator-&gt;sort('agence_id');?&gt;&lt;/th&gt; &lt;th class="actions"&gt;&lt;?php __('Actions');?&gt;&lt;/th&gt; &lt;/tr&gt; </code></pre> <p><img src="https://i.stack.imgur.com/lcaqy.png" alt="Sorting won&#39;t work, it&#39;ll just order ASC, not DESC."></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload