http://www.rhubarbphp.com/manual/module.leaf.commoncontrols/selection/attached-data#content
When setting the array values:
[1, 'John', ['Forename' => 'John', 'Surname' => 'Smith', 'Age' => 23]],
[2, 'Jane', ['Forename' => 'Jane', 'Surname' => 'Doe', 'Age' => 33]],
[3, 'Clover', ['Forename' => 'Clover', 'Surname' => 'Daniels', 'Age' => 43]]
]);
Or you can override on the model:
{
protected function getPublicPropertyList()
{
$list = parent::getPublicPropertyList();
$list[] = 'FirstName';
$list[] = 'Surname';
return $list;
}
}
Then to use it in the javascript:
if (items.length > 0){
alert(items[0].data.FirstName);
}