1
這是一個簡單的用例,用於存儲具有繼承性的一對多(或甚至一對一)。 Ext JS如何用它的JSON閱讀器處理這個問題?獲取Ext JS協會,繼承和存儲工作
以下代碼提供幾個僞模型和數據來說明使用情況:
僞代碼示例:
Models:
Car {
model,
year,
color
}
Truck extends Car {
bedLength,
duality
}
Van extends Car {
leftSlideDoor,
rightSlideDoor,
tailGate
}
CarOwner {
name,
cars <Car>
}
Data:
carOwners:
[
{
name: "Sencha",
cars: [
{
color: "Brown",
model: "Mater"
type: "truck",
duality: "false",
bedLength: "10"
},
{
color: "red",
model: "sienna",
type: "van",
tailGate: "true",
leftSlideDoor: "true",
rightSlideDoor: "true"
}
]
}
]
當數據被加載時,一個「正確」型汽車的被實例化和加載。 這怎麼能在Ext JS中完成?