0

I have a code as following

            var selectedWindows = new ShowSelectedFilesFolderWindow;
            selectedWindows.setParentData(MainFileGrid.selectedItems);

The problem is that when I retrieved the list from the dialog, the list(hierarchical data) was sorted according to the way the selection was made in the main window. For example, if I selected bottom-up,it displayed folder first, if I selected up-to-bottom, it displayed file first.

How can I keep the default folder first display ?

ketan
  • 19,129
  • 42
  • 60
  • 98
zawhtut
  • 8,335
  • 5
  • 52
  • 76

1 Answers1

0

I got it solved as the following

    public function setParentData(obj:Object):void{
        var tempArr:Array  = obj as Array;
        if(tempArr[0].Type == "file"){
            this.parentData = tempArr.reverse();
        }else{
            this.parentData = tempArr;
        }
    }
zawhtut
  • 8,335
  • 5
  • 52
  • 76