gpt4 book ai didi

extjs- 'Store is undefined'

转载 作者:行者123 更新时间:2023-11-30 13:40:00 25 4
gpt4 key购买 nike

我很确定这是一个微不足道的问题,我只是有点傻。非常感谢您的帮助。

在 controls/dashboard.js 我有:

    Ext.ill.WCSS.controls.dashboard = {
xtype:'portal',
region:'center',
margins:'35 5 5 0',
items:[{
columnWidth: 1,
style:'padding:10px',
items:[{
title: 'My Cluster Jobs',
layout:'fit',
html: "test"
}]
},{
columnWidth: 1,
style:'padding:10px',
items:[{
title: 'All Cluster Jobs',
iconCls: 'icon-queue',
html: "test",
items: new Ext.grid.GridPanel({
title: 'Cluster Job Queue',
store: Ext.ill.WCSS.stores.dashboardClusterJobs,
width: 791,
height: 333,
frame: true,
loadMask: true,
stateful: false,
autoHeight: true,
stripeRows: true,
floating: false,
footer: false,
collapsible: false,
animCollapse: false,
titleCollapse: false,
columns:[
{
xtype: 'gridcolumn',
header: 'Job ID',
sortable: true,
resizable: true,
width: 100,
dataIndex: 'JB_job_number',
fixed: false
},
{
xtype: 'gridcolumn',
header: 'Priority',
sortable: true,
resizable: true,
width: 100,
dataIndex: 'JAT_prio',
fixed: false
},
{
xtype: 'gridcolumn',
header: 'User',
sortable: true,
resizable: true,
width: 100,
dataIndex: 'JB_owner'
},
{
xtype: 'gridcolumn',
header: 'State',
sortable: true,
resizable: true,
width: 100,
dataIndex: 'state'
},
{
xtype: 'gridcolumn',
header: 'Date Submitted',
sortable: true,
resizable: true,
width: 100,
dataIndex: 'JAT_start_time'
},
{
xtype: 'gridcolumn',
header: 'Queue',
sortable: true,
resizable: true,
width: 100,
dataIndex: 'queue_name'
},
{
xtype: 'gridcolumn',
header: 'CPUs',
sortable: true,
resizable: true,
width: 100,
dataIndex: 'slots'
}
],
bbar: {
xtype: 'paging',
store: 'storeClusterQueue',
displayInfo: true,
refreshText: 'Retrieving queue status...',
emptyMsg: 'No jobs to retrieve',
id: 'clusterQueuePaging'
}
})
}]
}]
};

很简单,注意对“Ext.ill.WCSS.stores.dashboardClusterJobs”的引用

所以在 stores/dashboard.js 中我只有这个:

Ext.ill.WCSS.stores.dashboardClusterJobs = new Ext.data.XmlStore({
storeId: 'storeClusterJobs',
record: 'job_list',
autoLoad: true,
url: 'joblist.xml',
idPath: 'job_info',
remoteSort: false,
fields: [
{
name: 'JB_job_number'
},
{
name: 'JAT_prio'
},
{
name: 'JB_name'
},
{
name: 'JB_owner'
},
{
name: 'state'
},
{
name: 'JAT_start_time'
},
{
name: 'slots'
},
{
name: 'queue_name'
}
]
});

我运行代码并得到“商店未定义”:S 这让我很困惑。所有 javascript 都以正确的顺序包含在内。

<script type="text/javascript" src="/js/portal.js"></script>
<script type="text/javascript" src="/js/stores/dashboard.js"></script>
<script type="text/javascript" src="/js/controls/dashboard.js"></script>

谢谢大家!

最佳答案

这可能是命名空间问题。您的 Ext.ns 声明是什么样的?

关于extjs- 'Store is undefined',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2809719/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com