【问题标题】:ng-Grid columns stacked or not displaying properlyng-Grid 列堆叠或未正确显示
【发布时间】:2015-07-09 18:33:58
【问题描述】:

我正在尝试通过 AngularJS 在 ng-grid 中显示示例数据。一切对我来说都是正确的。如果我在本地项目中的模块定义中传递“ngGrid”,那么这些列就会堆叠在一起。我尝试在 plunker 中执行此操作,但渲染不正确。

这里是示例代码。

http://plnkr.co/edit/AHQUjbus908HBLxUaIWr

【问题讨论】:

  • 好吧,你的 plunker 有错误(你没有正确包含库)。
  • 除了NG-Grid.js、angular.js、jQuery,还需要哪些库?你能帮忙澄清一下吗?
  • 没关系。我明白你在说什么。我们拥有正确版本的库使其工作。 - 感谢您的帮助。

标签: angularjs stacked ng-grid


【解决方案1】:

问题在于对外部 nggrid 文件的引用。很多时候引用 github 文件并不能很好地工作。我已经将 nggrid js 和 css 移动到本地 plunkr 文件中,并分叉了你的 plunkr。现在可以了。

http://plnkr.co/edit/N5T0Ys3Fc58NymAvzMFj?p=preview

【讨论】:

    【解决方案2】:

    尝试添加

    minWidth: 50,
    width: '*'
    

    在你的 columnDefs 中,

    {
    field: 'severity',
    displayName: 'Severity',
    resizable: true,
    minWidth: 50,
    width: '*'
    }
    

    它对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多