ExtJS:组合数据存储未加载到字段集中
我有一个字段集问题。该表单有一个下拉组合,其中包含用户可以选择的日期范围。日期位于 ArrayStore 中。如果我把它放在字段集之外,它就可以完美地工作。但是一旦进入字段集,它就不会加载数据。我也尝试过使用 JSON 存储,得到相同的结果。
这是代码:
{
name: 'DateFieldSet',
fieldLabel: '',
labelSeparator: ':',
title: 'Choose a date range',
collapsible: false,
autoHeight: true,
allowBlank: true,
items: [
{
fieldLabel: 'Days in past',
hiddenName: 'DateRangeCombo',
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'rangeValue',
'rangeDescription'
],
data: [
[30, '30 days (04/04/2011 - 05/04/2011)'],
[60, '60 days (03/05/2011 - 05/04/2011)'],
[90, '90 days (02/03/2011 - 05/04/2011)'],
[120, '120 days (01/04/2011 - 05/04/2011)'],
[180, '180 days (11/05/2010 - 05/04/2011)'],
[270, '270 days (08/07/2010 - 05/04/2011)'],
[365, '1 year (05/04/2010 - 05/04/2011)']
]
}),
displayField: 'rangeDescription',
valueField: 'rangeValue',
editable: true,
triggerAction: 'all',
width: 150,
listeners: {select:function() {var numberOfDays = ReportForm.form.findField('DateRangeCombo').getValue();var newDate = DateAdd('05/04/2011', 'D', (numberOfDays * -1)); ReportForm.form.findField('StartDate').setValue(newDate);}},
xtype: 'combo'
},
{
fieldLabel: 'Or specify your own:',
labelStyle: 'width: 100%; font-weight: bold; text-align: left; color: #15428b; font-size: 11px;',
labelSeparator: '',
xtype: 'label'
},
{
fieldLabel: 'Start Date',
name: 'StartDate',
allowBlank: true,
vtype: '',
checked: false,
value: '04/04/2011',
xtype: 'datefield'
},
{
fieldLabel: 'End Date',
name: 'EndDate',
allowBlank: true,
vtype: '',
checked: false,
value: '05/04/2011',
xtype: 'datefield'
}
],
xtype: 'fieldset'
}
它对我来说看起来很正常。
编辑〜这是错误:
this.proxy 未定义
并不是说它有多大帮助。
I have a fieldset issue. The form has a dropdown combo with date ranges the user can select. The dates are in an ArrayStore. If I put it outside the fieldset, it works perfectly. But once inside the fieldset, it will not load the data. I've tried this with JSON stores as well, with the same result.
Here's the code:
{
name: 'DateFieldSet',
fieldLabel: '',
labelSeparator: ':',
title: 'Choose a date range',
collapsible: false,
autoHeight: true,
allowBlank: true,
items: [
{
fieldLabel: 'Days in past',
hiddenName: 'DateRangeCombo',
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'rangeValue',
'rangeDescription'
],
data: [
[30, '30 days (04/04/2011 - 05/04/2011)'],
[60, '60 days (03/05/2011 - 05/04/2011)'],
[90, '90 days (02/03/2011 - 05/04/2011)'],
[120, '120 days (01/04/2011 - 05/04/2011)'],
[180, '180 days (11/05/2010 - 05/04/2011)'],
[270, '270 days (08/07/2010 - 05/04/2011)'],
[365, '1 year (05/04/2010 - 05/04/2011)']
]
}),
displayField: 'rangeDescription',
valueField: 'rangeValue',
editable: true,
triggerAction: 'all',
width: 150,
listeners: {select:function() {var numberOfDays = ReportForm.form.findField('DateRangeCombo').getValue();var newDate = DateAdd('05/04/2011', 'D', (numberOfDays * -1)); ReportForm.form.findField('StartDate').setValue(newDate);}},
xtype: 'combo'
},
{
fieldLabel: 'Or specify your own:',
labelStyle: 'width: 100%; font-weight: bold; text-align: left; color: #15428b; font-size: 11px;',
labelSeparator: '',
xtype: 'label'
},
{
fieldLabel: 'Start Date',
name: 'StartDate',
allowBlank: true,
vtype: '',
checked: false,
value: '04/04/2011',
xtype: 'datefield'
},
{
fieldLabel: 'End Date',
name: 'EndDate',
allowBlank: true,
vtype: '',
checked: false,
value: '05/04/2011',
xtype: 'datefield'
}
],
xtype: 'fieldset'
}
It looks perfectly normal to me.
EDIT ~ Here's the error:
this.proxy is undefined
Not that it helps much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你错过了
mode
配置..you miss
mode
config..