Angularjs智能表响应表

时间:2016-07-20 18:09:58

标签: angularjs html5 responsive-design datatables smart-table

我查看了智能表网站http://lorenzofox3.github.io/smart-table-website/中的所有示例并查看了掠夺者,但我无法找到任何响应示例,其中列隐藏在此数据表示例中,其中"加&# 34;当示例变得很小时出现符号,例如https://l-lin.github.io/angular-datatables/#/withResponsive,我尝试了智能表网站中的示例,但是当我缩小屏幕时,表格变得难以理解,我没有将屏幕缩小到很多我试过这个例子https://plnkr.co/edit/fcdXKE?p=preview

angular.module('myApp', ['smart-table'])
.controller('mainCtrl', ['$scope', function ($scope) {

    var
        nameList = ['Pierre', 'Pol', 'Jacques', 'Robert', 'Elisa'],
        familyName = ['Dupont', 'Germain', 'Delcourt', 'bjip', 'Menez'];

    function createRandomItem() {
        var
            firstName = nameList[Math.floor(Math.random() * 4)],
            lastName = familyName[Math.floor(Math.random() * 4)],
            age = Math.floor(Math.random() * 100),
            email = firstName + lastName + '@whatever.com',
            balance = Math.random() * 3000;

        return{
            firstName: firstName,
            lastName: lastName,
            age: age,
            email: email,
            balance: balance
        };
    }


    $scope.displayed = [];
    for (var j = 0; j < 50; j++) {
        $scope.displayed.push(createRandomItem());
    }
}])
.directive('stRatio',function(){
    return {
      link:function(scope, element, attr){
        var ratio=+(attr.stRatio);

        element.css('width',ratio+'%');

      }
    };
});

有没有办法让这些加号出现或者类似于使表格真正响应?

0 个答案:

没有答案