static-data

How to sort an ArrayCollection in Flex

戏子无情 提交于 2020-01-02 03:53:06
问题 I want to sort an Arraycollection by fieldName as ascending. Here's my code and I want to know whether it's right. Do you have any suggestions? public static function arrayCollectionSort(ar:ArrayCollection, fieldName:String, isNumeric:Boolean):void {var dataSortField:SortField = new SortField(); dataSortField.name = fieldName; dataSortField.numeric = isNumeric; var numericDataSort:Sort = new Sort(); numericDataSort.fields = [dataSortField]; arrCol.sort = numericDataSort; arrCol.refresh();}

Reference Data Pattern

僤鯓⒐⒋嵵緔 提交于 2019-12-11 03:55:38
问题 Similar to this thread, but not exactly: How To Cache Information In A Threadsafe Manner What is the usual pattern for dealing with "reference data" - data that is frequently read by an application, usually externalized in a database or properties file, but updated very infrequently (days, weeks, months)? When the data is updated, it would be updated externally. Would this normally be a singleton that I could inject with a DAO and would thus be able to manage its own contents? I like the idea

How to sort an ArrayCollection in Flex

柔情痞子 提交于 2019-12-05 06:05:26
I want to sort an Arraycollection by fieldName as ascending. Here's my code and I want to know whether it's right. Do you have any suggestions? public static function arrayCollectionSort(ar:ArrayCollection, fieldName:String, isNumeric:Boolean):void {var dataSortField:SortField = new SortField(); dataSortField.name = fieldName; dataSortField.numeric = isNumeric; var numericDataSort:Sort = new Sort(); numericDataSort.fields = [dataSortField]; arrCol.sort = numericDataSort; arrCol.refresh();} Sagar Rawal The code you have is correct, except for a type. arrCol should be ar . The code looks almost