Some DataGrid questions (export, delete row)

  • Afternoon Kirupa community,:afro: I've been working on a shopping cart and have some quick questions regarding the DataGrid component. I have checked all archives and dont see an answer to my question so here they go..

    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


  • I have answered one of my own questions and thought I would share with the community.

    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.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Some DataGrid questions (export, delete row) , Please add it free.