angular-ui/ui-grid

Adding a ng-dblclick on rows causes cell selection on mousedown

Open

#5.060 aberto em 3 de fev. de 2016

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (2.496 forks)batch import
good first issue

Métricas do repositório

Stars
 (5.395 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Hello,

I'm trying to trigger an action on a double click on a row. It works fine except that when I add the ng-dblclick directive on my row, it causes that cells are somehow "selected" (see the attached picture) when I do a mousedown on them.

image

The edit mode is disabled as the 'ui.grid.edit' module is not imported.

To add the double click I have customized the templateRow :

appScopeProvider: {
                    onDblClick : function(row, $event) {
                             $timeout.cancel($scope.selectTimer);
                            var url = '//google.com';
                           $window.open(url, "_blank", "height=600,width=800,toolbar=no,location=no,menubar=no,titlebar=no");
                         }
                    },

                //The row template is updated to add the dble click action 
                rowTemplate : $templateCache.get('ui-grid/ui-grid-row').replace("<div ", "<div ng-dblclick=\"grid.appScope.onDblClick(row, $event)\" "),

I cannot figure out where this is coming and if I replace ng-dblclick by "ondblclick", I don't have the cell selected.

Is this a bug or is there a way to disable this behavior ?

Guia do colaborador