How to delete rows using BatchUpdate scenario?

25 replies. Last post: December 9, 2010 1:11 AM by Glenn Layaar
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Shawn AugustMember

Can someone provide me with an example on how to delete rows from a WebGrid using BatchUpdate using JavaScript? The following code doesn't seem to do anything? I would expect the row to disappear but show up in the grid's WebGridRowChanges collection

function WebGrid_GetSelectedRow(controlID) 
{
    try
    {
        // Get selected row
        var grid = ISGetObject(controlID);
        if (grid == null) { return; }
        var selObj = grid.GetSelectedObject();
        if (selObj == null) { return; }
        return selObj.ToRowObject();
    }
    catch (ex) { ShowJSException(ex); }
}

function WebGrid_DeleteSelectedRow(controlID) 
{
    try 
    {
        // Delete selected row
        var row = WebGrid_GetSelectedRow(controlID);
        if (row == null) { return; }
        row.Delete();
    }
    catch (ex) { ShowJSException(ex); }
}
All times are GMT -5. The time now is 6:47 PM.
Previous Next