Some DataGrid questions (export, delete row)
January 6th, 2009
First off my DataGrid is populated within the flash document, at which point I would like to export both columns to a php which sends it off to Verisign's payment processor. How can I assign column data a specific variable?
My second question would be removing items from the DataGrid. If a user wants to remove a product from their cart, how would I go about adding the functionality of removing a row from the DataGrid?
Thanks very much for your responces!
-alex
how would I go about adding the functionality of removing a row from the DataGrid?
To do this place this function on your main timeline
//on cell click
var myListener = new Object();
myListener.cellPress = function(event) {
cell = event.itemIndex;
trace("The cell at " + cell + " has been clicked");
};
dataGrid.addEventListener("cellPress", myListener);
This makes a function which keeps track of what cell is clicked in the dataGrid.
Create a button which says Remove Item or something along those lines. Place this code in the button
on (release){
_root.dataGrid.removeItemAt(_root.cell);
}
That should do it, will need a msg box pop up telling the user to select a cell if there's no cell selected upon button press.
#If you have any other info about this subject , Please add it free.# |