2013-12-08 57 views
0

在我的web應用程序中,我需要將我的麪包屑數組鏈接鏈接到打開對話框的javascript函數。我嘗試過,但沒有工作。任何人都會很好地幫助我,因爲我是Yii的新手。當我點擊創建按鈕時,它應該轉到javascript函數名稱「addStore」,它將爲渲染的視圖打開一個對話框。任何正文幫我Yii將breadcrumbs數組鏈接鏈接到javascript函數

我試圖

$this->menu=array(
    array('label'=>'List Store', 'url'=>array('index')), 
    array('label'=>'Create Store', 'url'=>array('create',array('onclick'=>"{addStore();$('#dialogStore').dialog('open')}"))), 
); 
+0

爲什麼你首先使用麪包屑菜單?你在這裏有一個定期的菜單,所以'CMenu'將是更清潔的選擇。 –

回答

1

的代碼你嘗試htmlOptions

$this->menu=array(
    array(
     'label'=>'List Store', 
     'url'=>array('index') 
     'htmlOptions' => array(
      'onclick' => "{addStore();$('#dialogStore').dialog('open')}", 
     ), 
    ), 

並且您也可以使用link attribute