Sorting CakePHP:select字段中视图中的分页器排序
我想通过从下拉列表中选择,对Sorting CakePHP:select字段中视图中的分页器排序,sorting,cakephp,pagination,Sorting,Cakephp,Pagination,我想通过从下拉列表中选择,对视图中的内容进行排序 可以通过在表元素中进行排序 <tr> <th><?= $this->Paginator->sort('category_id') ?></th> <th><?= $this->Paginator->sort('subcategory_id') ?></th>
视图中的内容进行排序
可以通过在表元素中进行排序
<tr>
<th><?= $this->Paginator->sort('category_id') ?></th>
<th><?= $this->Paginator->sort('subcategory_id') ?></th>
<th><?= $this->Paginator->sort('product_code') ?></th>
</tr>
但是我想要一个下拉选择列表。从列表中选择选项后,数据将被排序
<select>
<option><?= $this->Paginator->sort('category_id') ?></option>
<option><?= $this->Paginator->sort('subcategory_id') ?></option>
<option><?= $this->Paginator->sort('product_code') ?></option>
</select>
您可以通过post DATA执行普通表单、更改时提交以及在控制器操作中设置可排序。我不想创建表单。只有一个列表,没有提交按钮。选择列表将按顺序排序,并且不需要在标题中写cakephp3标记,我看到您在每个问题上都这样做了…我说的是在更改时提交,没有附加按钮,我从来没有这样使用排序分页。您可以使用选择标记进行排序。您需要提供id来选择标记,并使用jquery/ajax对数据进行排序。您可以使用普通表单,更改时提交,并通过post DATA在控制器操作中设置可排序。我不想创建表单。只有一个列表,没有提交按钮。选择列表将按顺序排序,并且不需要在标题中写cakephp3标记,我看到您在每个问题上都这样做了…我说的是在更改时提交,没有附加按钮,我从来没有这样使用排序分页。您可以使用选择标记进行排序。您需要提供id来选择标记,并使用jquery/ajax对数据进行排序。