2013-05-10 49 views
2

在我的網頁我有三個選項卡視圖pages.For此我使用了CHtml :: ajaxLink如下對視圖的Yii ajaxLink jQuery是不工作

<li > 
        <?php echo CHtml::ajaxLink("Manual Billing", CController::createUrl('billing/manualbilling'), array('update' => 'html', 
           'type' => 'POST',));?> 
       </li> 
       <li> 
         <?php echo CHtml::ajaxLink("Billing History", CController::createUrl('billing/historyBilling'), array('update' => 'html', 
           'type' => 'POST', 

            ));?> 
       </li> 
       <li> 
         <?php echo CHtml::ajaxLink("Merchant Wise Billing Status", CController::createUrl('billing/manualbilling'), array('update' => 'html', 
           'type' => 'POST'), array(//htmlOptions 
           // 'class' => "reportlink" 
          ));?> 
       </li> 

給出網址的頁面加載,但問題是我已經給視圖頁面內的一些jQuery函數來實現不起作用的datatable。

$(document).ready(function() { 
     $('#example').dataTable({ 
      "sScrollY": "400px", 
      "bPaginate": false, 
      "oLanguage": { 

       "sEmptyTable": "No records to display" 
      }, 

      "sDom": 'T<"clear">lfrtip', 
      "aaSorting": [], 
      "aoColumns": [ 
       { "bSortable": false }, 
       null, 
       null, 
       null, 
       null, 
       null, 
      ], 
      "oTableTools": { 
       "sSwfPath": "<?php echo Yii::app()->request->baseUrl; ?>/media/js/TableTools/media/swf/copy_csv_xls_pdf.swf",          
       "aButtons": [ 
        { 
         "sExtends": "print", 
         "sInfo": "Please press escape when print is completed." 
        } 

        //             { 
        //     "sExtends": "collection", 
        //     // "sButtonText": "Save", 
        //     "aButtons": [ "csv", "xls", "pdf" ] 
        //    } 
       ] 
      } 

     }); 

    }); 

它甚至沒有進入上的document.ready()。請幫助

+0

你沒有告訴你如何整合javascript。你使用'Yii :: app() - > clientScript-> registerScript()'嗎? – 2013-05-10 07:32:48

+0

是的。我用這個 – 2013-05-10 09:00:44

+0

你應該看看CJuiTabs部件來設置你的標籤。 (雖然不是你的問題的解決方案)http://www.yiiframework.com/doc/api/1.1/CJuiTabs – 2013-05-10 21:54:00

回答

1

感謝@Kevin希金斯問題使用CJuiTabs小部件

$tabs = array(); 

       $tabs['Manual Billing'] = array( 
         'id'=>'dataFieldsTab', 
         'class'=>'bill', 
         'content'=>$this->renderPartial('manualbilling',$paramsm,true), 
       ); 

       $tabs['Billing History'] = array( 
         'id'=>'linkedChildrenTab1', 
         'class'=>'bill', 

         'content'=>$this->renderPartial('historyBilling',$paramsh,true), 
       ); 


       $this->widget('zii.widgets.jui.CJuiTabs', array( 
         'tabs' => $tabs, 
         'options' => array( 
           'collapsible' => false, 
           'active' => 0, 
         ), 
       )); 

感謝每一位尋求幫助解決