power-media / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

Make TDataFieldAccessor capable to access data in nested arrays #426

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Original discussion: http://www.pradoframework.com/forum/index.php?topic=15479.0

The idea behind this feature request is that it's common to have a datasource 
made up fo nested arrays or objects, like this:

[id] => 2
[username] => "username"
[firstname] => "firstname"
[lastname] => "lastname"
[Role] => Array (
   [id] => 1
   [name] => "admin"
)

Inside a TRepeater/TDataGrid/etc, it would be nice to be able to use:

<com:TBoundColumn HeaderText="Nachname" DataField="Role.name" />

to access directly the value of $item['Role']['name']

Original issue reported on code.google.com by ctrlal...@gmail.com on 29 Oct 2012 at 8:34

GoogleCodeExporter commented 8 years ago
Fixed in r3214
Note: to mantain backward compatibility, prado checks if array['xxx.yyy'] 
exists in the array before trying to split up the field name and access 
array['xxx']['yyy'].

Original comment by ctrlal...@gmail.com on 2 Nov 2012 at 5:05