Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
755
how to fire row update if datasource only contains single record
posted

Hi,

I use cellediting behaviour. If my grid contains more than one row I get the rowupdating event if the user switches from row to row. Sometimes my grid only contains a single record and I never receive a RowUpdating event.

Do you have a solution/workaround?

Roland

Parents
  • 2783
    Verified Answer
    posted

    Hi Ronald,

    You can trigger the update your cell in JS, when the user finishes editing the last cell, by handeling the ExitedEditMode client event, and doing the following in the event handler:

    function exitedEditMode(grid, args)
    {
        var cell = args.getCell();
        var column = cell.get_column();
        var editBehavior = grid.get_behaviors().get_editingCore(); //.get_behaviors().get_cellEditing();
                   
        if (column.get_visibleIndex() == grid.get_columns().get_length() - 1)
            editBehavior.commit();
    }

    Thanks,

    Olga

Reply Children
No Data