在功能上角NG-格申报gridOptions [英] Angular ng-grid declare gridOptions in function

查看:110
本文介绍了在功能上角NG-格申报gridOptions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在新的角度,我尝试申报NG网gridOption在函数中,因为我想要的数据来自服务器,然后它不火。
但是,如果我这样做,它导致错误:

I'm new at angular, and I try to declare gridOption for ng-grid Within a function, because I want it not fire before the data come from the server. But if I do so, it cause an error:

TypeError: Cannot set property 'gridDim' of undefined

请,我迫切需要帮助!

先谢谢了。

推荐答案

要停止渲染,直到数据到达做这样的事情。

To stop rendering till the data arrives do something like

<div ng-if="contentAvailable">
   <ng-grid/>
</div>

在你当数据可用设置的gridoptions对象,然后按 contentAvailable 来真正的控制器。

In you controller when the data is available setup the gridoptions object, followed by contentAvailable to true.

这篇关于在功能上角NG-格申报gridOptions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆