angular JS中使用jquery datatable添加ng-click事件

'use strict';

app.controller('DataTableCtrl', function ($scope, $compile) {
    $scope.show = function () {
        alert("ddd");
    }
    $scope.simpleTableOptions = {
        sAjaxSource: '/Home/Index',
        "sServerMethod": "POST",
        "bProcessing": true,
        "bServerSide": true,
        "bPaginate": true,
        aoColumns: [
            { data: 'id' },
            { data: 'title' },
            {
                data: 'add_time', "mRender": function (data) {
                    return '<a ng-click="show()">测试</a>';
                }, "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                    
                    $compile(nTd)($scope);
                }
            }
         
        ],
        "sDom": "Tflt<'row DTTTFooter'<'col-sm-6'i><'col-sm-6'p>>",
        "iDisplayLength": 10,
        "oTableTools": {
            "aButtons": [
                "copy", "csv", "xls", "pdf", "print"
            ],
            "sSwfPath": "assets/swf/copy_csv_xls_pdf.swf"
        },
        "language": {
            "search": "",
            "sLengthMenu": "_MENU_",
            "oPaginate": {
                "sPrevious": "上一页",
                "sNext": "下一页"
            }
        },
        "aaSorting": [],

       
    };
});

  的股份大概

posted on 2016-04-18 21:52  落叶子  阅读(4600)  评论(0编辑  收藏  举报

导航