Sending metadata in a json response to a Tree Grid causes the control to silently fail in a loading state.
Here is the panel definition:
This JSON response works as expected:
This final response fails:
Why does updating a Tree Grid with response metaData fail?
Chrome provides the following:
Code:
Uncaught TypeError: undefined is not a function
appendChild
appendChild
Ext.cmd.derive.fillNode
Ext.cmd.derive.onProxyLoad
Ext.cmd.derive.triggerCallbacks
Ext.cmd.derive.setCompleted
Ext.cmd.derive.setSuccessful
Ext.cmd.derive.process
Ext.cmd.derive.processResponse
(anonymous function)
Ext.apply.callback
Ext.cmd.derive.onComplete
Ext.cmd.derive.onStateChange
Ext.Function.j.bind
Here is the panel definition:
Code:
{
xtype: 'treepanel',
height: 250,
width: 400,
title: 'Tree Grid Panel',
store: 'TreeStore',
rootVisible: false,
viewConfig: {
},
columns: [
{
xtype: 'treecolumn',
dataIndex: 'key',
text: 'Nodes',
flex: 1
},
{
xtype: 'gridcolumn',
dataIndex: 'val',
text: 'Value'
}
]
}
This JSON response works as expected:
Code:
{
"children": [
{
"avg": 3.4,
"children": [
{
"avg": 4.5,
"children": [],
"id": "slave-1",
"key": "alpha-v1",
"leaf": true,
"val": 1.5
}
],
"id": "master-1",
"key": "alpha",
"leaf": false,
"val": 1.5
},
{
"avg": 2.2,
"children": [
{
"avg": 1.1,
"children": [],
"id": "slave-2",
"key": "beta-v1",
"leaf": true,
"val": 2.25
}
],
"id": "master-2",
"key": "beta",
"leaf": false,
"val": 2.25
}
],
"offset": 0,
"total_count": 2
}
This final response fails:
Code:
{ "children": [
{
"avg": 3.4,
"children": [
{
"avg": 4.5,
"children": [],
"id": "slave-1",
"key": "alpha-v1",
"leaf": true,
"val": 1.5
}
],
"id": "master-1",
"key": "alpha",
"leaf": false,
"val": 1.5
},
{
"avg": 2.2,
"children": [
{
"avg": 1.1,
"children": [],
"id": "slave-2",
"key": "beta-v1",
"leaf": true,
"val": 2.25
}
],
"id": "master-2",
"key": "beta",
"leaf": false,
"val": 2.25
}
],
"metaData": {
"columns": [
{
"dataIndex": "key",
"text": "Target",
"xtype": "treecolumn"
},
{
"dataIndex": "val",
"text": "Last",
"xtype": "numbercolumn"
},
{
"dataIndex": "avg",
"text": "Avg",
"xtype": "numbercolumn"
}
],
"fields": [
{
"name": "key",
"type": "string"
},
{
"text": "val",
"type": "float"
},
{
"text": "avg",
"type": "float"
}
]
},
"offset": 0,
"total_count": 2
}
Why does updating a Tree Grid with response metaData fail?
Aucun commentaire:
Enregistrer un commentaire