【发布时间】:2016-05-09 06:58:11
【问题描述】:
好的,这是我的问题。我有一个带有一些选项的选择字段。选择字段用于过滤我的列表。所以在选择字段中有按纪律过滤。当用户选择它时,将显示当前隐藏的学科字段,但是当用户选择按学生过滤时,学科字段将隐藏自己,而学生字段(也被隐藏)将显示。但我似乎无法弄清楚代码。顺便说一句,我是煎茶触摸的新手。我正在使用 sencha touch 2.4.2。这是我的代码:-
{
//first item of vbox(1)
xtype: 'container',
layout: 'hbox',
style: 'background-color:' + _ListHeaderColor() + '; color: floralwhite;',
margin: '10 10',
items: [
{
//first item of hbox
html: "Request List (Request Patient)",
margin: '15 15',
flex: 1
}, //end of first item of hbox
{
//second item of hbox
xtype: 'selectfield',
id: 'choose',
name: 'filter',
label: 'Filter By',
margin: '5 5',
width: '20%',
options: [
{ text: '-', value: 'none' },
{ text: 'Discipline', value: 'disc' },
{ text: 'Student', value: 'stud' },
],
listeners: {
change: function (field, newValue) {
if (value) {
var disp = Ext.getCmp(newValue).show();
var disp = Ext.getCmp(newValue).hide();
}
else {
var disp = Ext.getCmp(newValue).show();
var disp = Ext.getCmp(newValue).hide();
}
}
}
},
{
xtype: 'selectfield',
id: 'disc',
name: 'discipline',
label: 'Discipline',
margin: '5 5',
hidden: true,
store: _DataStore_RequestPatient,
displayField: 'text',
valueField: 'value'
},
{
xtype: 'searchfield',
id: 'stud',
name: 'student',
label: 'Students',
hidden: true
}
]
},
【问题讨论】:
标签: extjs touch sencha-touch-2