我正在开发一个cakephp项目,并且正在开发cakephp.正如标题中所提到的,我需要对mysql查询的结果集进行分页,以便在视图中显示它们.
通过这种方式,我可以对"Asin"模型的结果进行分页.
$this->paginate =array('Asin'=>array(
'fields' => array('sku','fnsku'),
'conditions' => $marketplace,
'page' => 1, 'limit' => 20,
'order' => array('Asin.asin' => 'asc')
)
$data = $this->paginate('Asin',$criteria);
Run Code Online (Sandbox Code Playgroud)
我还需要一种方法来对以下查询的结果集进行分页.
$resultset = $this->Asin->query("SELECT * FROM products INNER JOIN asins ON products.id=asins.id ORDER BY products.id");
Run Code Online (Sandbox Code Playgroud)
我该如何添加分页?
如何让一个项目的组合框不可选择,因为我需要在一个组合框与子课题单独项目.
是否可以单独修改该特定项目的字体?
jComboBox_btech_course.setFont(new java.awt.Font("Tahoma", 0, 14));
jComboBox_btech_course.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select Course" }));
jComboBox_btech_course.setName("");
private class theHandler implements ActionListener
{
public void actionPerformed(ActionEvent evt)
{
//BTech courses
if(jComboBox_mtech_dept.getSelectedItem().equals("Civil Engineering"))
{
jComboBox_btech_course.removeAllItems();
jComboBox_btech_course.addItem("Building Construction");
jComboBox_btech_course.addItem("Principle And Practice");
jComboBox_btech_course.addItem("Surveying");
jComboBox_btech_course.addItem("Engineering Geology");
jComboBox_btech_course.addItem("Structural Analysis");
jComboBox_btech_course.addItem("Hydraulic Engineering");
jComboBox_btech_course.addItem("Environmental Engineering");
jComboBox_btech_course.addItem("Structural Design");
jComboBox_btech_course.addItem("Geotechnical Engineering");
/*This item has to be unselectable*/
jComboBox_btech_course.addItem("***Sub-topic***");
jComboBox_btech_course.addItem("Transportation Engineering");
jComboBox_btech_course.addItem("Foundation Engineering");
jComboBox_btech_course.addItem("Estimation & Valuation");
jComboBox_btech_course.addItem("Hydrology & Flood Control");
jComboBox_btech_course.addItem("System Analysis, Project Planning And Construction Management");
jComboBox_btech_course.addItem("Irrigation Engineering"); …Run Code Online (Sandbox Code Playgroud)