Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ext.js关联未及时完成加载_Javascript_Extjs_Associations - Fatal编程技术网

Javascript ext.js关联未及时完成加载

Javascript ext.js关联未及时完成加载,javascript,extjs,associations,Javascript,Extjs,Associations,我在成本中心和网站模型之间建立了关联 我的问题是,当我尝试在CostCenterGrid中显示站点时,关联没有及时加载 items: [ { xtype: 'gridpanel', itemId: 'CostCenterGrid', columns: [ { text: MR.locale.Name, dataIndex: 'Name',

我在成本中心和网站模型之间建立了关联

我的问题是,当我尝试在CostCenterGrid中显示站点时,关联没有及时加载

 items: [
    {
        xtype: 'gridpanel',
        itemId: 'CostCenterGrid',
        columns: [
            {
                text: MR.locale.Name,
                dataIndex: 'Name',
                renderer: function(translation) {
                    return translation.get('ActualTranslation');
                },
                width: 150
            }, {
                text: MR.locale.Site,
                dataIndex: 'Site',
                renderer: function(value, meta, record) {
                    return record.getSite().get('ActualName');

                },
                width: 150
            },
        ],
        store: 'MR.store.administration.CostCenter',
    }
正如您所看到的,我有一个站点属性的自定义渲染器。第一次渲染网格时,该站点未显示。再次运行时,站点将正确可见


如何克服这个问题?

通常当您在第二次加载时遇到这种异常情况时,它可能与异步进程有关。 我认为您的记录对象最初没有准备好或为空。
确保在渲染数据之前获取数据。

是的,我知道数据是异步加载的。我想知道如何在渲染网格之前等待加载所有存储。