-1

I've an xml containing a nested structure

<building>
  <name>Bld No.2</name>
  <rooms>
    <room>
      <number>10</number>
    </room>
    <room>
      <number>11</number>
    </room>
  </rooms>
</building>

using model mapping, I can put the data into the grid by this:

fields:[
  {name: 'roomNumber', mapping: 'rooms > room > number'},
  ...
]

and this obviously doesn't work since it only parses the first room and generates one row in the grid.

So how can I make the mapping to parse multiple substructures?

And how can I extend the grid view to support this structure? Something like embedding a tree or list into a grid row would be perfect for me, though I know it's hard.

4

1 回答 1

0

您需要创建一个商店,并且可以将您的网格绑定到该商店。

将模型中的阅读器定义为:

reader: {
    type : 'xml',
    record: 'room',
    root: 'rooms'
}
于 2013-07-23T11:40:43.217 回答