dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] [MX04] delete row in datagrid

  1. #1
    Member
    Join Date
    Jan 2008
    Posts
    84

    resolved [RESOLVED] [MX04] delete row in datagrid

    I can delete a selected row in a data grid by using "x" but I can not reset the array.
    Also I have - and + buttons but can not seem to target the qty amount.
    Could someone look at the source file and tell me what I am doing wrong.

    Thanks
    Last edited by shaunfreeman; 08-27-2009 at 11:02 AM.

  2. #2
    Member
    Join Date
    Jan 2008
    Posts
    84
    I have hit a wall with this. Can't seem to empty the array.
    I tried using:
    PHP Code:
    arrayname[] = "" 
    but that noes not work.

    Here how I remove the row in the datagrid:

    PHP Code:
    var dgListener:Object = new Object();
    dgListener.cellPress = function(evt:Object) {
        var 
    num:Number evt.target.selectedIndex;
        var 
    cell:String evt.columnIndex+", "+evt.itemIndex;
        
    tmp evt.target.columns[evt.columnIndex].columnName;
        
    trace(+evt.target.getItemAt(evt.itemIndex)[tmp]);
        
    //delete x
        
    xbutton = +evt.target.getItemAt(evt.itemIndex)[tmp];
        if (
    xbutton == "  x") {
            
    trace("action1");
            
    grid_dg.dataProvider.removeItemAt(grid_dg.selectedIndex)
            
    //aItem = new Array();
        
    }
        if (
    xbutton == " +") {
            
    trace("action2");
        }
        if (
    xbutton == " -") {
            
    trace("action3");
        }
    };
    grid_dg.addEventListener("cellPress"dgListener); 
    Someone please give us some direction. I am getting a bit

  3. #3
    Member
    Join Date
    Jan 2008
    Posts
    84
    Managed to sort it out and now working on the empty cart btn.
    PHP Code:
    PHP Code:
    var aItem[arrayname].quantity=0
    But how do I target all of the arraynames and set all quantity=0?

    Any ideas

  4. #4
    Member
    Join Date
    Jan 2008
    Posts
    84
    Ok I should of know this one.

    PHP Code:
    for (var i in aItem) {
            
    aItem[i].quantity 0;
            
    grid_dg.dataProvider.removeAll(); 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center