使用ExtJS完全加载网格后的处理 [英] Process after grid was loaded completely using ExtJS

查看:123
本文介绍了使用ExtJS完全加载网格后的处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ExtJS将数据加载到网格中,我想在数据完全放入网格之后添加一些其他进程。

I am using ExtJS to load data to a grid, and I want to add some additional processes after data was put on grid completely.

我的上下文是数据放在网格上,我将检查所有行,并根据指定的条件将其中的一些标记为禁用,并将工具提示放到行(解释为什么禁用)。我试图使用2个事件:Grid的Afterrender和加载网格的商店,但是它们没有起作用。

My context is, after data was put on grid, I will check all rows, and mark some of them as disabled based on a specified condition and put tooltip to row (explain why it is disabled). I tried to use 2 events: 'afterrender' of Grid, and 'load' of grid's store, but they did not work.

因为 grid afterrender在第一个网格初始化时被触发,不关心数据加载。当数据被预取存储(不在屏幕上呈现)时, store''load'被触发,所以我无法获得行< div> 将其设为禁用。

Because grid's 'afterrender' was fired when first grid initialization, not concern to data load. store's 'load' was fired when data was prefetch to store (not render on screen), so I cannot get the row <div> to style it as disabled.

那么当数据被加载并完全呈现在网格上时,检测什么事件呢?我如何实现这个要求?

So, what is the event to detect when data was loaded and rendered completely on grid? And how can I implement this requirement?

推荐答案

我认为对于你的任务,你不需要等到网格加载,而是使用网格面板的 viewConfig 选项来配置如何精确显示您的行:

I think for you task you don't need to wait until grid is loaded but rather use viewConfig option for the grid panel to configure how exactly to display your rows:

viewConfig: {
   getRowClass: function(r) {
      if (r.get('disabled'))
         return 'disabled-class';
      else 
         return '';
   }
}

这篇关于使用ExtJS完全加载网格后的处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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