开发者

AdvancedDataGrid GroupingField

开发者 https://www.devze.com 2023-04-04 06:46 出处:网络
need my AdvancedDat开发者_如何学PythonaGrid group by the name of the person, but I\'m having trouble because the groupingField not accept \"objectPeople.idPeople\"

need my AdvancedDat开发者_如何学PythonaGrid group by the name of the person, but I'm having trouble because the groupingField not accept "objectPeople.idPeople"

the name of the groupingField not accept "objectPeople.idPeople"?

GroupingField name="people.idPeople" <--error??


That's because dot is not allowed in field handling.

Explanation.

Inside DataGrid addressing groupingField property from your item is held with square braces operator:

item[groupingField]

This addressing only supports one level. E.g. if you've got object inside object, you cannot address properties of the second one with square braces in first:

var outer:Object = new Object();
var inner:Object = new Object();
outer["property"] = inner;
inner["value"] = 0;
trace(outer["property.value"]); // runtime error
trace(outer.property.value); // traces 0

outer["property.value"] = 1; // creates property "property.value" in outer
trace(outer["property.value"]); // traces 1
trace(outer.property.value); // still traces 0

Answer.

If you have idPeople inside your item, you should specify groupingField="idPeople".

If you have objectPeople with idPeople property inside your item, you should (for instance) write a getter in your item to avoid multiple levels and specify its name in groupinf field property - groupingField="idPeople":

public function get idPeople():Number
{
    return objectPeople.idPeople;
}

// ...
trace(item["idPeople"]); // works now
0

精彩评论

暂无评论...
验证码 换一张
取 消