Angular ui-grid double click row to open pop-up for editing a row

前端 未结 3 1360
孤独总比滥情好
孤独总比滥情好 2021-02-20 14:41

VERSION:

I am using Angular ui-grid version 3.0.0-RC.18 (http://ui-grid.info/).

PROBLEM

I want to implement a double-c

3条回答
  •  鱼传尺愫
    2021-02-20 15:04

    I've used Aquiles solution and reduced scopes just to appSCope, see here.

    I've rewrite code to showInfo becomes to $scope:

    $scope.showInfo = function(row) {
        var modalInstance = $modal.open({
          controller: 'InfoController',
          templateUrl: 'ngTemplate/infoPopup.html',
          resolve: {
            selectedRow: function () {                    
                return row.entity;
            }
          }
       });
    
       modalInstance.result.then(function (selectedItem) {
         $log.log('modal selected Row: ' + selectedItem);
       }, function () {
         $log.info('Modal dismissed at: ' + new Date());
      });
    }
    

    At gridOptions just used appScope:

    $scope.gridOptions = {
    
       showFooter: true,
       enableSorting: true,
       multiSelect: false,
       enableFiltering: true,     
       enableRowSelection: true, 
       enableSelectAll: false,
       enableRowHeaderSelection: false,
       selectionRowHeaderWidth: 35,  
       noUnselect: true,
       enableGridMenu: true,
       columnDefs: [{displayName:'Name',field:'name'},{displayName:'Gender',field:'gender'},{displayName:'Company',field:'company'}],
       rowTemplate: "
    " };

    Too, I added columnDefs to show that rowTemplate don't interfere with grid rendering.

提交回复
热议问题