Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Thank you for the example
I want to sort the DataGrid by the score.
When I click on the DataGrid score column head to sort it, It throws error:
ReferenceError: Error #1069: Property customFields['score'] not found on com.adobe.rtc.sharedManagers.descriptors.UserDescriptor and there is no default value.
Views
Replies
Total Likes
Hi Isa,
It's possible that this line was written with a typo :
<mx:DataGridColumn id="c2" headerText="Score" dataField="customFields['score']" labelFunction="scoreLabelFunction" />
Try removing the dataField included there, so :
<mx:DataGridColumn id="c2" headerText="Score" labelFunction="scoreLabelFunction" />
Check out the docs here :
http://livedocs.adobe.com/flex/3/langref/mx/controls/dataGridClasses/DataGridColumn.html#dataField
Which say that you need to build a sortCompareFunction on the DataGridColumn for this kind of case.
hope that helps
nigel
Views
Replies
Total Likes
Thank you for the tips,
i removed the dataField and wrote a sortCompareFunction.
The DataGrid is sortable now :-)
<mx:DataGridColumn id="c2" headerText="Score" sortCompareFunction="sortMe" labelFunction="scoreLabelFunction" />
import mx.utils.ObjectUtil;
private function sortMe(obj1:Object, obj2:Object):int{
return ObjectUtil.compare(obj1,obj2)
}
But this works only when the dataFileds are not changing.
When the dataFileds are changing the DataGrid overwrite the rows.
It seems that the DataGrid don't know where the new rows position after the sort.
It puts the rows on the same old position?
Views
Replies
Total Likes
Views
Likes
Replies