2 Replies Latest reply on Feb 9, 2007 7:23 AM by berklee

    DataGrid column order - with actionscript?

      I can't seem to find an effective way to get the data laid out the way I want.

      Imagine this scenario:

      I have a single-column list of all the fields in a database table on the left, and a display table on the right (which starts with no columns in it).

      When I drag an item from the left grid to the right one, I do a remote call (with AMFPHP) that returns me the primary key for each row in the table, along with each column that's been dragged onto the right grid (which I'm keeping track of in an array).

      For some reason I can't seem to find a way to prevent the visible columns from being sorted by their array keys, no matter what I do. I'd like to set it up so that as a user selects fields from the left grid, those items are shown as the rightmost column in the grid. Does anyone know a way I can dynamically load in columns to the datagrid so that I can set their order (or at least have the option of loading them in from left to right by putting them into a new array or something)?

      Because of the dynamic nature of the app, I can't be sure what table I'm going to be viewing, so hard-coding the fields isn't an option.