Consider the trade-offs: (1) 1. Can implement cancel functionality more easily 2. Marginally better performance (but not worth worrying about)
(2) 1. Changes saved even if app/browser crashes 2. Easier to implement I'd go with (2) unless you really need cancel functionality. Premature optimization is the root of all evil, and (2) will give you a simpler design. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -----Original Message----- From: bredwards358 <[EMAIL PROTECTED]> Reply-To: [email protected] To: [email protected] Subject: [flexcoders] Seeking Advice regarding saving changes Date: Tue, 10 Jun 2008 14:51:48 -0000 In the application I am working on, the user can drag and drop items from one datagrid to another. Now regardless of how the user exits the window, the data is always saved. My question is basically, what would be the best strategy for saving these changes. The dataProviders for both grids are array collections populated with info gathered from a local database. I can think of two ways to do this thus far, both can work as far as I can tell. Strategy 1: Wait for the user to close out the window and then save all the changes at once. For a new order, this is as simple as a loop through the array collection and doing an insert for each row. However for updating orders, I'm not sure but is it possible to check for changed values while looping through and then doing an update for the changes? I see the itemChanged property and it looks like the thing I need. This is in my opinion the toughest to implement if just for the update functionality. Strategy 2: On every dragDrop event, on every change in the itemRenderers, do either an insert or an update statement depending on whether a new item is dropped in, or being updated. This to me seems like the more practical solution and what I am considering at the moment. Thoughts? Opinions? Thanks in advance. Brian Ross Edwards Tech-Connect LLC

