4 Replies Latest reply on Mar 19, 2008 7:14 AM by MatthewAbbott

    FileSystemDataGrid

    MatthewAbbott
      I am using the FileSystemDataGrid and i am pointing it to the File.applicationDirectory as it directory. The issue i have is when i rename a file in that directory, both the old file and the new file shows up. When i delete a file, that file still shows up in the Grid.

      I have some work arounds im working with but Why when i call the refresh() method of the FileSystemGrid it doesnt refresh with the new data? It currently shows the old files and renamed files. Some of those files dont even exist anymore in the directory, yet they still show up in the grid.

      I thought id ask here to see what other options I can try.

      Thank you

      -Matthew
        • 1. Re: FileSystemDataGrid
          anirudhs Level 2
          Hi,

          I've tried adding, renaming and deleteing directories and files. Hitting refresh seems to update the FileSystemDataGrid correctly.

          Here's my MXML:

          <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" >

          <mx:VBox width="100%" height="100%">
          <mx:Button label="Refresh" click="fgrid.refresh()"/>
          <mx:FileSystemDataGrid id="fgrid" directory="{File.applicationDirectory}" width="100%" height="100%"/>
          </mx:VBox>
          </mx:WindowedApplication>

          Strange that it's not working for you. Could you post a isolated test case reproducing the problem?
          • 2. Re: FileSystemDataGrid
            MatthewAbbott Level 1
            When i copied the code you posted into a new mxml file and ran it, Initally it showed the old deleted files in the DataGrid. If i click on the refresh button, it did nothing, or didnt reflect any changes.

            What am i doing wrong??
            • 3. Re: FileSystemDataGrid
              anirudhs Level 2
              Initially showed the old deleted files? You mean before you deleted any files?

              Sounds like you're looking at the wrong folder. Make sure trace(File.applicationDirectory.nativePath) is where you're changing files.
              • 4. Re: FileSystemDataGrid
                MatthewAbbott Level 1
                I did end up getting it to work. Apparently you cannot view the application working within Flex Builder, and you need to compile and run it as an AIR app. In order to continually check the folder im pointing to, i added a timer() to incrementally check that folder and refresh the grid.

                Thanks for your help, and if you additional suggestions, im all airs.. i mean ears har har