Javascript ExtJS过滤器组合框动态
我有一个带有多个组合框的属性网格,我想根据上一个框中选择的内容过滤一个框中的值 我的代码如下所示:Javascript ExtJS过滤器组合框动态,javascript,extjs,combobox,Javascript,Extjs,Combobox,我有一个带有多个组合框的属性网格,我想根据上一个框中选择的内容过滤一个框中的值 我的代码如下所示: var tempPropGrid = me.getView().add( { xtype:'propertygrid', width: 80, header: false, title: 'prop grid', //for some reason the headers are not hiding, we
var tempPropGrid = me.getView().add(
{
xtype:'propertygrid',
width: 80,
header: false,
title: 'prop grid',
//for some reason the headers are not hiding, we may need to deal with this using CSS
//hideHeaders: true,
enableColumnResize: false,
sortableColumns: false,
nameColumnWidth: 1,
source: record.data,
sourceConfig: {
teamName: {
editor: Ext.create('Ext.form.ComboBox', {
store: teams,
queryMode: 'local',
displayField: 'teamName',
valueField: 'teamName'
}),
displayName: 'Team'
},
leadDev : {
editor: Ext.create('Ext.form.ComboBox', {
store: teamMembers.filter('teamName', teamName.value), // this probably won't work but you get the idea
queryMode: 'local',
displayField: 'personName',
valueField: 'personName'
}),
displayName: 'Lead Dev'
},
{
"periodName": "Week1",
"teamName": "tango",
"roleName": "SWE III",
"roleExperience": "3",
"id": "21ea7f61-a9a5-4dbd-b405-e7a0449f8096"
},
我的JSON对象如下所示:
var tempPropGrid = me.getView().add(
{
xtype:'propertygrid',
width: 80,
header: false,
title: 'prop grid',
//for some reason the headers are not hiding, we may need to deal with this using CSS
//hideHeaders: true,
enableColumnResize: false,
sortableColumns: false,
nameColumnWidth: 1,
source: record.data,
sourceConfig: {
teamName: {
editor: Ext.create('Ext.form.ComboBox', {
store: teams,
queryMode: 'local',
displayField: 'teamName',
valueField: 'teamName'
}),
displayName: 'Team'
},
leadDev : {
editor: Ext.create('Ext.form.ComboBox', {
store: teamMembers.filter('teamName', teamName.value), // this probably won't work but you get the idea
queryMode: 'local',
displayField: 'personName',
valueField: 'personName'
}),
displayName: 'Lead Dev'
},
{
"periodName": "Week1",
"teamName": "tango",
"roleName": "SWE III",
"roleExperience": "3",
"id": "21ea7f61-a9a5-4dbd-b405-e7a0449f8096"
},
因此,本质上我是将一个项目分配给一个团队,然后根据我选择的团队,我想根据他们在该团队中的情况选择一个leadDev
我不知道如何提取组合框的值并动态应用过滤器,以便提供任何帮助。网格中的每一行都是一个模型。因此,在您的
leadDev
组合框中,您只需侦听'expand'
事件,然后检索当前行模型并将该模型中的值应用于过滤器。
它应该如下所示(未选中):
当用户从第一个组合框中选择值时,您需要更新当前模型