AngularJS NG-电网开始减少? [英] AngularJS ng-Grid starts minimized?

查看:259
本文介绍了AngularJS NG-电网开始减少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用纳克网格V2.0.7,问题是在第一时间即纳克网格表示,它被最小化。这里是我的意思的图片:

只有点击最小化表(上图)后,充分表显示正常(下图)..
这里是code我使用的是:

  $ scope.gridOptions = {
    数据:'jsonData.value',
    多选:假的
};

为什么会出现这种情况?

编辑:这是在HTML文件中定义的:

 < D​​IV CLASS =gridStyleNG-秀=(dataViewType =='表')NG-格=gridOptions>< / DIV>


解决方案

尝试使用 NG-斗篷指令网格元素。

例如一个简单的div:

 < D​​IV NG-斗篷>< / DIV>


  

的ngCloak指令用于prevent的角度HTML模板
  被简单地通过浏览器在其原始(未编译)显示
  而您的应用程序加载形成。使用这个指令以避免
  不良闪烁效应造成的HTML模板显示。


文档: http://docs.angularjs.org/api/ng.directive: ngCloak

I'm using ng-Grid v2.0.7, and the problem is that the first time that ng-grid shows, it is minimized. Here is a picture of what I mean:

Only after clicking on the minimized table (the top picture), the full table displays normally (the bottom picture).. Here is the code I'm using:

$scope.gridOptions = {
    data: 'jsonData.value',
    multiSelect: false
};

Why is this happening?

EDIT: Here is the definition in the html file:

<div class="gridStyle" ng-show="(dataViewType == 'table')" ng-grid="gridOptions"></div>

解决方案

Try to use the ng-cloak directive on your grid element.

For example on a simple div :

<div ng-cloak></div> 

"The ngCloak directive is used to prevent the Angular html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. Use this directive to avoid the undesirable flicker effect caused by the html template display."

Docs : http://docs.angularjs.org/api/ng.directive:ngCloak

这篇关于AngularJS NG-电网开始减少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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