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
223
Skipping uneditable columns when tabbing
posted

How can you set up the grid, so that when the user tabs, only editable cells are in the tab order?

Parents
  • 194
    posted

    As far as I know you'd have to use javascript to do this.

    Java script:

    function OnUwgKeyDown(gn,cellId,KeyStroke)
    {
        // Tab Key
       if (KeyStroke == 9)
       {
            SelectNextCell(gn);
            return true;
       }
    }

    function SelectNextCell(gridClientId)
    {
        var grid = igtbl_getGridById(gridClientId);
        var cell = grid.getActiveCell();
       
        if(cell != undefined && cell != null)
        {
              var nextCell = cell.getNextTabCell();
             
              while(nextCell != undefined && nextCell.isEditable() == false)
              {
                 nextCell = nextCell.getNextTabCell();
              }
                       
              if(nextCell != undefined)
              {
                  cell.setSelected(false);
                  nextCell.activate();
                  nextCell.setSelected(true);
              }
        }
    }

    Grid:

    <DisplayLayout>
     <ClientSideEvents KeyDownHandler="OnUwgKeyDown" />
    </DisplayLayout>

     

Reply Children