我想知道是否可以动态创建网格视图。我会尽我所能来解释......动态创建网格EXTJS
我目前有有不同的区域数据库表中,我创建了解决此一格,你可以添加新条目到这个网,这反过来将其添加到表..
我也有包含姓名,电话号码联络人数据库表,并使用所有的区域作为一个下拉。您可以再次通过网格在此表格中添加新条目。
最后我有一个第三格栅,显示所有接触的人,分解到自己的区域。我遇到的问题是如何使其动态?目前我已经硬编码区域标题和填充一个正确过滤的网格,但是如果某人完全添加了新的区域会怎样?我如何使用适当的过滤器为新添加的区域创建标题和网格?
第三格栅代码:
Ext.define('myproject.example', {
extend: 'Ext.form.Panel',
alias: 'widget.********',
requires: [
'store.exampleStore'
],
modal: true,
draggable: true,
header: {
title: 'Technical Advisors Contact Information',
height: 55,
items: [{
xtype: 'button',
text: 'X',
listeners: { click: 'onModalX' }
}]
},
scrollable: true,
align: 'center',
floating: true,
width: 1500,
height: 800,
items: [{
xtype: 'grid',
title: 'Region: ME',
scrollable: true,
collapsible: true,
store: { type: 'exampleStore', filters: [{ property: 'Region', value: 'ME' }, { property: 'Active', value: 'true' }] },
columns: [{
text: 'Contact',
dataIndex: 'ContactName',
sortable: true,
flex: 2
}, {
text: 'Office #',
dataIndex: 'Office',
sortable: true,
flex: 1
}, {
text: 'Home #',
dataIndex: 'Home',
sortable: true,
flex: 1
}, {
text: 'Pager #',
dataIndex: 'Pager',
sortable: true,
flex: 1
}, {
text: 'Cellular #',
dataIndex: 'Cellular',
sortable: true,
flex: 1
}, {
text: 'Area',
dataIndex: 'Region',
sortable: true,
flex: 3
}] //continues...
您正在使用什么版本的ExtJS的吗? – tommyO
我正在使用extjs 6.2 – TigerDave