在我的網頁我有三個選項卡視圖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()。請幫助
你沒有告訴你如何整合javascript。你使用'Yii :: app() - > clientScript-> registerScript()'嗎? – 2013-05-10 07:32:48
是的。我用這個 – 2013-05-10 09:00:44
你應該看看CJuiTabs部件來設置你的標籤。 (雖然不是你的問題的解決方案)http://www.yiiframework.com/doc/api/1.1/CJuiTabs – 2013-05-10 21:54:00