我正在使用从数据库行MetroUI CSS
创建一个:ListView
<?php
use Phalcon\Mvc\Controller;
class loadReservationTablesController extends Controller
{
public function indexAction(){
$request = $this->request;
if ($request->isPost() == true) {
if ($request->isAjax() == true) {
$critere = array();
$critere['salle_code'] = $_POST['salle_code'];
$ret = ReservationTable::lireParCritere($critere);
if ($ret->count() > 0) {
$html = '';
foreach ( $ret as $key => $val ) {
$html .= '<div class="list">
<div class="list-content" id="table_'.$ret[$key]->table_code.'">
<span class="list-subtitle">'.$ret[$key]->table_lib.'</span>
<span class="list-remark">'.$ret[$key]->reserver.'</span>
</div>
</div>';
}
echo $html;
}
else {
echo '<br/><div class="sub-header">No records to display</div>';
}
}
}
$this->view->disable();
}
}
在视图中:
$(document).ready(function() {
$("div[id^='table_']").on("click", function(){
alert("uuuuuu");
});
});
在运行时警报不显示,并且控制台不包含错误;甚至日志文件也没有错误。当我右键单击该页面以查看其源代码时,记录不在!那么如何解决呢?