Angularjs ngGrid无法正确显示

Angularjs ngGrid无法正确显示,angularjs,ng-grid,Angularjs,Ng Grid,我正在使用bower(下面是json文件) 我无法启动简单的ngGrid。它是如此简单(我必须说ng grid非常棒),以至于我不知道我做错了什么 index.jade: div(ng-controller='Ctrl') div(style="border: 1px solid rgb(212,212,212); width : 400px; height: 300px", ng-grid='gridOptions') 控制员:咖啡: 'use strict' angular.mo

我正在使用bower(下面是json文件)

我无法启动简单的ngGrid。它是如此简单(我必须说ng grid非常棒),以至于我不知道我做错了什么

index.jade:

div(ng-controller='Ctrl')
    div(style="border: 1px solid rgb(212,212,212); width : 400px; height: 300px", ng-grid='gridOptions')
控制员:咖啡:

'use strict'

angular.module('client.controllers', [])

.controller('Ctrl', [
'$log'
'$scope'

($log, $scope) ->
  $scope.gridOptions = {
    data: 'myData'
    enablePinning: true
    columnDefs: [
      { field: "name", width: 120, pinned: true },
      { field: "age", width: 120 },
      { field: "birthday", width: 120 },
      { field: "salary", width: 120 }
    ]
  }

  $scope.myData = [
    { name: "Moroni", age: 50, birthday: "Oct 28, 1970", salary: "60,000" }
    { name: "Tiancum", age: 43, birthday: "Feb 12, 1985", salary: "70,000" }
    { name: "Jacob", age: 27, birthday: "Aug 23, 1983", salary: "50,000" }
    { name: "Nephi", age: 29, birthday: "May 31, 2010", salary: "40,000" }
    { name: "Enos", age: 34, birthday: "Aug 3, 2008", salary: "30,000" }
    { name: "Moroni", age: 50, birthday: "Oct 28, 1970", salary: "60,000" }
    { name: "Tiancum", age: 43, birthday: "Feb 12, 1985", salary: "70,000" }
    { name: "Jacob", age: 27, birthday: "Aug 23, 1983", salary: "40,000" }
    { name: "Nephi", age: 29, birthday: "May 31, 2010", salary: "50,000" }
    { name: "Enos", age: 34, birthday: "Aug 3, 2008", salary: "30,000" }
    { name: "Moroni", age: 50, birthday: "Oct 28, 1970", salary: "60,000" }
    { name: "Tiancum", age: 43, birthday: "Feb 12, 1985", salary: "70,000" }
    { name: "Jacob", age: 27, birthday: "Aug 23, 1983", salary: "40,000" }
    { name: "Nephi", age: 29, birthday: "May 31, 2010", salary: "50,000" }
    { name: "Enos", age: 34, birthday: "Aug 3, 2008", salary: "30,000" }
  ]
])
我得到的是:

鲍尔json:

{
"name": "main",
"version": "0.0.0",
"authors": [
    "gumba"
],
"license": "MIT",
"ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
],
"dependencies": {
    "querystring":"*",
    "angular": "*",
    "angular-sanitize": "*",
    "angular-resource": "*",
    "angular-route": "*",
    "angular-cookies": "*",
    "angular-mocks": "*",
    "bootstrap": "*",
    "sugarjs": "*",
    "datatables":"*",
    "ng-grid":"*"
}
}

将ng网格从2.0.14降级到2.0.11对我来说是可行的。
我猜这只是一些向后兼容性问题,将在以后的版本中解决,所以这里没有什么有趣的

如果您移除了“锁定”:是否有效?还要注意的是,如果有区别的话,您定义的包含DIV的宽度小于所有col组合的宽度。我试图删除pinted属性,但没有进行更改。宽度计算的目的是(使用固定特征),您可以尝试改用新的uiGrid。我正在使用它,没有你看到的任何问题。这看起来可能是一个CSS相关的问题。我会检查各种样式,并在您使用的任何浏览器的调试器中摆弄它们是的,我知道ui网格。但请注意,ui网格团队在他们的报告中写道,他们还没有准备好进行生产(这仍然是测试前的版本)。