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
255
UltraWebGrid - add new row - how to exit edit mode on enter
posted

Hello,

I have a UltraWebGrid with AllowAddNewDefault=Yes set. The Grid only has a single column.

The Grid shows an editable row unterneath the filled rows where I can double click to edit. If I end the edit with "Tab" key, the editing is ended, and a new AddNew row is added under the existing rows so that I can add further rows if I wish so. However, if I end the editing with the enter key, the editing field is closed, but no new AddNew row template row is shown until I mouse-click somewhere on the grid.

I want the users to be able to end the editing with the Enter key and immediately have the AddNew template shown. I tried to call row.endEditRow(true); in the AfterExitEditModeHandler method, but this does not seem to help:

function CroFunctions_AfterExitEditModeHandler(gridName, rowId, bSaveChanges) {
        var row = igtbl_getRowById(rowId);
        row.endEditRow(true);

}

 

The method is called when I press enter, but endEditRow(true); does not seem to make UltraWebGrid add a the new add row template... What should I do instead?

Thanks

Parents
  • 255
    Verified Answer
    posted

    Figured it out, I can simply call commit() in the exit edit mode handler

     

        var grid = igtbl_getGridById(gridName);
            var ar = grid.getActiveRow();
            if (ar.IsAddNewRow) {
                ar.commit();
            }

Reply Children
No Data