Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] ui-grid-selection causing tabbing issue #1662

Closed
juliekirwin opened this issue Oct 1, 2014 · 6 comments
Closed

[3.0] ui-grid-selection causing tabbing issue #1662

juliekirwin opened this issue Oct 1, 2014 · 6 comments

Comments

@juliekirwin
Copy link

So I am currently experiencing the same issues as #1639 , but I am also having an issue with tabbing through the grid. I am using ui-grid-edit and ui-grid-cellnav along with ui-grid-selection. When I add in selection, the tabbing of the grid goes haywire.

If I click on a cell to edit and then tab out it skips a cell and goes to the last cell. If I press tab again it completely loses focus. If I remove selection from the grid everything works as expected.

HTML:

<div ui-grid="shiftGrid" ui-grid-edit ui-grid-cellnav ui-grid-selection class="gridShopShifts"></div>

Controller:

    $scope.shiftGrid = {
        enableSorting: true,
        enableFiltering: true,
        enableCellEditOnFocus: true,
        enableRowSelection: true,
        columnDefs: [
          { field: 'ShiftID', displayName: 'Shift ID', type: 'number',  enableCellEdit: true, cellClass: 'colAlign', width: '10%' },
          { field: 'ShiftDesc', displayName: 'Description', type: 'string', enableCellEdit: true, cellClass: 'colAlign', width: '55%' },
          { field: 'Capacity', displayName: 'Capacity', type: 'number', enableCellEdit: true, width: '35%', cellFilter: 'addCommasFilter', cellClass: 'colAlignLastCol' },
        ]
    };

Here is a screenshot of the grid:
image
EXAMPLE: If I was in edit mode and clicked cell number 1, it will jump to number 2 when tab is pressed and then lose focus when pressed again.

@PaulL1
Copy link
Contributor

PaulL1 commented Oct 1, 2014

I think this is the issue I fixed in #1608 and #1609. It may not have made it to the distributed bower version - have you upgraded to the latest? You may need to build from source to get this update.

@PaulL1 PaulL1 added this to the 3.0 milestone Oct 1, 2014
@juliekirwin
Copy link
Author

Yesterday was the last time I pulled the most recent code

@PaulL1
Copy link
Contributor

PaulL1 commented Oct 3, 2014

Are you able to create a plunker of this? I had a problem like this earlier, and I thought I'd fixed it (it remains fixed in my version). So obviously the symptom/cause must be a little different than what I had.

@juliekirwin
Copy link
Author

I was having trouble making a plunker for some reason so I edited one of your existing ones and put some of the features I'm using on it. http://plnkr.co/edit/pGUZduChPmG7Pg1AregU?p=preview It doesn't behave the same as my grid but I did notice the tabbing still is off. it jumps up to filtering and then back down to the rows. For my code, besides what I already provided there isn't much more to it. I am using some gridApi, but other then that not much...

$scope.shiftGrid.multiSelect = true;

  //checks for valid data (not duplicate not blank) in ReadyForSave and then updates or creates in db
    $scope.shiftGrid.onRegisterApi = function (gridApi) {
        $scope.gridApi = gridApi;
        gridApi.edit.on.afterCellEdit($scope, function (rowEntity, colDef, newValue, oldValue) {
            if (newValue != oldValue && ReadyForSave(rowEntity, colDef.field, oldValue)) {
                    if (rowEntity.ShiftKey < 0) {
                        createShift(rowEntity);
                    } else {
                        editShift(rowEntity);
                    }
                }
        });

       //using row selection for deleting 
        gridApi.selection.on.rowSelectionChanged($scope, function (row) {
            if (row.isSelected) {
                $scope.selectedShifts.push($scope.shiftGrid.data[row.index].ShiftKey);
            } else {
                for(var i=0; i < $scope.selectedShifts.length; i++){
                    if($scope.shiftGrid.data[row.index].ShiftKey == $scope.selectedShifts[i]){
                        $scope.selectedShifts.splice(i, 1);
                    }
                }
            }
        });
    };

@juliekirwin
Copy link
Author

So I think what you did in #1685 may have worked for me. I pulled the most recent code and it seems the tabbing issue and all is fixed. The only thing that's off is I keep getting the issue I was having in #1601 [check marks above grid area] on initial load of my grid or when I refresh the page. I can only get it to look correct by re-sizing the window.

@c0bra
Copy link
Contributor

c0bra commented Oct 8, 2014

Since the tabbing issue is fixed with #1685 I'm closing this. If there's still a problem that is identified in #1601 then please comment there so it can be re-opened.

@c0bra c0bra closed this as completed Oct 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants