2012-07-19 22 views
0

這是我的代碼:如何添加自定義的JS功能笨錨,而使用表庫

foreach($patients as $patient) { 
    $this->table->add_row(++$i, 
          $patient->opd_no, 
          $patient->sname.', '.$patient->fname.' '.$patient->mname, 
          strtoupper($patient->gender), 
          date('M d, Y', strtotime($patient->birth_date)), 
          $patient->address_no.' '.$patient->address_st.' '.$patient->address_brgy.' '.$patient->address_local.' '.$patient->address_province, 
          anchor('consultation/queue/'.$patient->pk_id, 'Initial', ar 

    ray('class' => 'queue')) 
); 

我想它在錨補充。

編輯: 行,所以我加入這個希望這將是一個解決辦法:

anchor('#'.$patient->pk_id, 'Initial', array('class' => 'queue', 'rel' => 'ic')) 

,並通過jQuery使用rel屬性來調用一個函數試過。事情是這樣的:

$('a[rel=ic]').click(function() {}); 

但隨後一個笨錯誤頁面顯示出來說

你是在尋找正在 笨動態生成的頁面。

回答

0

我找到了解決辦法。除了使用CodeIgniter的錨,我轉而使用本地的HTML超級鏈接標籤<a>

"<a href='#' class='queue' id='init_d'>Initial</a>" 

這是一個更容易添加使用jQuery和前錯誤顯示不出來了一個js。

0

這裏是另一個選項供你使用(模式)

錨( '家/ SHOWPAGE', '顯示頁面',陣列( '的onClick'=> 'Inital()')