Exyjs4 字段映射问题



我在 extjs4 中工作。我有格式的 json =

[
    {
        "id": 47,
        "review": null,
        "Versions": [
            {
                "id": 44,
                "version": 1,
                "Item": null,
                "file": {
                    "fileName": "File 98",
                    "title": null
                }
            }
        ]
    },
    {
        "id": 47,
        "review": null,
        "Versions": [
            {
                "id": 45,
                "version": 1,
                "Item": null,
                "file": {
                    "fileName": "try.xls",
                    "title": null
                }
            }
        ]
    }
]

在模型中,我想访问这些字段。所以我把映射写成=

{name : 'versionId' , type : 'int' , mapping : 'Versions.version'},
{name : 'fileName' , type : 'string' , mapping : 'Versions.file.fileName'}

但它始终将版本ID和文件名显示为空白。那么如何在extjs4中进行这些映射

我认为模型中不能有字段类型对象。

您将必须创建一个不同的商店,其中根是版本,并从那里映射您的字段...我也会在版本中扁平该文件对象。

最新更新