I am nearly done implementing database interactivity with the piece of
the application I'm working on. One problem remains before the minor
stuff which will wait until after all crucial functionality is finished.
What's supposed to happen and what actually does happen except for the
issue is that for each order there is a header attached to it. The user
can open up a list of orders which is represented by the headers. From
there the user can click to edit an order which brings up the actual
order itself from the needed table. The issue is that when the user
wishes to delete an order, the order gets deleted, but the products
associated with said order remain, only one gets deleted. While
everything pretty much works, all those leftover items in the table
building up is not good.
Here's the code so far:
private function deletePORO():void
{
try
{
selectedIndex = dgOrders.selectedItem.ROID;//Index of the item
being selected
dataManager.deleteRO(selectedIndex);//Deletes the header row
DataManager.openIndex = selectedIndex;//Index of the rows that
need to be deleted from the actual Order
dataManager.getData("Repair Order");//Gets a copy of the info
from the database and assigns it to an arrayCollection
//Loops through the Repair order data deleting all rows with the
same ROID as the ROHeader being deleted
//Yet after all is said and done it only deletes one item and
nothing else
//Everything else works fine but this
var n:int = model.repairOrderData.length;
for (var i:int = 0; i < n; i++)
{
if(model.repairOrderData[i].ROID == selectedIndex)
{
dataManager.deleteROItem(model.repairOrderData[i].ROID);
}
}
model.roSearchData.removeItemAt(selectedIndex);
}
catch(ex:Error)
{
Alert.show("Error Found: " +
ex.toString(),"Error",Alert.OK,this);
}
}
Thanks in advance for any helpful hints or advice
Brian Ross Edwards
Tech-Connect LLC