如何使数据表列可单击

时间:2016-04-13 07:30:45

标签: javascript java html css

我正在制作一张桌子

HTML标记

<div class="container">
    <div ng-view></div>
</div>

的javascript

var app = angular.module('myHome', [ngRoute]); 
.config(['$routeProvider', function($routeProvider) { 

    $routeProvider
        .when('/', { templateUrl: '/index.html' })
        .when('/digital', { templateUrl: '/digital.html' })
        .when('/screen', { templateUrl: '/screen.html' })
        .otherwise({ redirectTo: '/' }); 
}]);

我的javascript文件

<table id="example" class="display" onload="callData()"></table>

我的css文件

function dataIsSet(){
var dataSet=[];
syncAjaxCall("POST","getGridData" ,"", "application/json")
.done(
        function(data) {
            if(data.response.Status==1){
            for(i=0;i<data.response.Result.length; i++){

                dataSet.push([])
            }
            for(i=0;i<data.response.Result.length; i++){
                dataSet[i].push(data.response.Result[i].interestsName);
                dataSet[i].push(data.response.Result[i].subscriberCount);
                dataSet[i].push(data.response.Result[i].messageCount);
            }
            }
            else
                showMessage("green", data.response.Description, "");
        });
if (dataSet[0].length==3)
    return dataSet;
}
function callData() {
debugger;
$('#example').DataTable( {
    data: dataIsSet(),
    columns: [
              { title: "Interest Name" },
              { title: "No of Subscribers" },
              { title: "No of Messages" }
              ] ,

 } );

 }

现在我想不做。消息列一个链接,它将从兴趣名称中获取值。

1 个答案:

答案 0 :(得分:0)

只需将它们插入PutItHeretag伙伴。

相关问题