ui-网格文本区域在编辑后不关闭

ui-grid textarea doesn't close after edit

当我完成编辑网格中的文本区域时,编辑模式没有关闭。

在这个 Plunker 中,如果您双击 Title 下的其中一个单元格,textarea 会正确打开,但在我单击单元格外后不会关闭。

http://plnkr.co/edit/9jrzziWOP6hWWQ1Gab39?p=preview

<div ui-grid="{ data: data, columnDefs: columnDefs }" ui-grid-edit></div>
var app = angular.module('app', ['ui.grid', 'ui.grid.edit']);

app.controller('MainCtrl', ['$scope', function ($scope) {
   $scope.data = [
     { name: 'John', title: 'CEO' },
     { name: 'Jane', title: 'Developer' }
   ];

   $scope.columnDefs = [
     {name: 'name', enableCellEdit: false},
     { name: 'title',
        cellEditableCondition: true,
        enableCellEdit: true,                                
        editType: 'textarea',
        editableCellTemplate: '<textarea rows="4" cols="140" ng-model="MODEL_COL_FIELD"></textarea>'
     }
   ];
 }]);

您的问题与以下行有关:

editableCellTemplate: '<textarea rows="4" cols="140" ng-model="MODEL_COL_FIELD"></textarea>'

在API中为uiGrid-edit, it states that you must have valid html, templateCache Id, or url that returns html content to be compiled when edit mode is invoked. In your case, you haven't included a means for the textarea to exit edit mode. To remedy this, include ui-grid-editor标记如下。

editableCellTemplate: '<textarea ui-grid-editor rows="4" cols="140" ng-model="MODEL_COL_FIELD"></textarea>'