esvit / ng-table

Simple table with sorting and filtering on AngularJS
http://esvit.github.io/ng-table
BSD 3-Clause "New" or "Revised" License
2.77k stars 851 forks source link

Show/Hide column not work. #968

Open iamvasim786 opened 7 years ago

iamvasim786 commented 7 years ago

Show/hide column not work, when click on checbox to show column data following error occurs - Error: v2.title is not a function Following my files - HTML -

{{row.name}} {{row.age}} {{row.uid}}

JS -

(function () { 'use strict'; angular .module('app') .controller('Home.IndexController', Controller);

function Controller(UserService,NgTableParams) {
    var vm = this;

    vm.user = null;

    initController();

    function initController() {
        // get current user
        UserService.GetCurrent().then(function (user) {
            vm.user = user;
            vm.cols = [
                { field: "name", title: "Name", show: true },
                { field: "uid", title: "UID", show: true },
                { field: "age", title: "Age", show: true }
              ];
            var data = [
                       {name: "Moroni",uid: "7273",age:"10"} 
                    ];
            vm.tableParams = new NgTableParams({}, { dataset: data});
        });
    } })();