如何检查dojo.datagrid加载完成? [英] how to check dojo.datagrid loading completed?

查看:138
本文介绍了如何检查dojo.datagrid加载完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个页面上有一个dojo.datagrid。 Datagrid及其存储(通过调用URL)通过声明方法创建。不是动态/程序化的。



我需要执行一个javascript方法,它显示一个div(这需要数据网格中很少的数据)就在我的datagrid下方。我应该在我的datagrid加载完成后才显示div,而不是之前。



我正在寻找像datagrid这样的onload完成的事件。 dojo.datagrid有什么事情吗?在事件的dojo.Datagrid文档列表中没有看到。



有没有办法检查dojo datagrid onload已完成?



有没有办法使用dojo.connect来处理这个?



请让我知道,如果我们有办法做到这一点...



谢谢,
Raj。

解决方案

本身从来没有真正加载所有可用的数据,它只显示其存储中的数据的子选择。



您需要按顺序绑定存储事件捕获onload事件。由于商店可以从很多地方加载数据,因此您需要将onComplete函数传递给网格存储的提取方法。

  grid.store.fetch({onComplete:function(items){// Do something}}); 

您还可以编程创建商店,使用onComplete侦听器调用fetch,一旦您完成修改商店的onComplete监听器中的项目,调用myGrid.setStore(myStore);


I have a dojo.datagrid in one of my pages. Datagrid and its store(by calling an URL) are created by declarative method. not by dynamic/programmatic.

I need to execute a javascript method which displays a div(which requires few data from the datagrid) just below my datagrid. I should display the div only after my datagrid loading completed;not before that.

I am looking for event like onload completed for datagrid. Is there any event do we have with dojo.datagrid? I don't see it in the event's list of dojo.Datagrid documentation.

Is there a way to check dojo datagrid onload completed?

Is there any way to use dojo.connect to handle this?

Please let me know if we have any way to do this...

Thanks, Raj.

解决方案

The datagrid itself never actually loads all of the data available, it is only showing a sub selection of the data in its store.

You will need to tie into the store events in order to catch the onload event. Since the store can load data from lots of places, you will need to pass an onComplete function to the fetch method of the grid store.

grid.store.fetch({onComplete : function (items) { // Do something }});

You could also create the store programatically, call fetch with your onComplete listener, and once you have finished the modification of the items in the store's onComplete listener, call myGrid.setStore(myStore);

这篇关于如何检查dojo.datagrid加载完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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