Mark,You may be able to only have one label function if you make use of the column that's passed in. In the mxml you could set the dataField on the column and refer to that in the label function.
private function labelOf(fullfieldname:String):Function { return function (item:Object, column:DataGridColumn):String { return item[fullfieldname]; }; } private function sortOf(fullfieldname:String):Function { return function (obj1:Object, obj2:Object):int { if(obj1[fullfieldname] < obj2[fullfieldname]) { return -1; } else if(obj1[fullfieldname] > obj2[fullfieldname]) { return 1; } else { return 0; } }; } <mx:DataGridColumn headerText="Roll Number" labelFunction="{labelOf('Parcels.ARN')}" sortCompareFunction="{sortOf('Parcels.ARN')}"/> <mx:DataGridColumn headerText="Name" wordWrap="true" labelFunction="{labelOf('LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName')"} sortCompareFunction="{sortOf('LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName')}"/>
Try:<mx:DataGridColumn id="rnc" labelFunction="labelFunction" headerText="Roll_Number" />labelFunction is a property of DataGridColumn. It should be set to the name of the function, so it could also be:labelFunction="myLabelFunction" if myLabelFunction was the function name.
<mx:DataGridColumn id="rnc" labelFunction="labelFunction" headerText="Roll_Number" />
Try using this:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/dataGridClasses/DataGridColumn.html#labelFunctione.g. private function labelFunction(item:Object, column:DataGridColumn):String { return item["LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName"]; }
private function labelFunction(item:Object, column:DataGridColumn):String { return item["LinkedTable.dbo.ASYST_NamesTable_PrimaryOnly.FullName"]; }
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.