1

ng-grids セルの編集可能なモードを 1 列のみのセルに制限することは可能ですか?
私は現在enableCellEditOnFocus: trueを使用しています。これにより、すべてのセルをグローバルに編集可能にすることができます。他のすべての列を「読み取り専用」にしたいので、1つの列に特定の editableCellTemplate があります。
angularjs と ng-grid を使用して最初の赤ちゃんの一歩を踏み出す初心者への提案はありますか?

これは、現在のグリッドの関連するセットアップです。

        var app = angular.module('myCoolGridApp', ['ngGrid']);
        app.controller('MyCtrl', function ($scope, $http) {

            $scope.gridOptions = {
                data: 'myData',
                enableCellSelection: true,
                enableRowSelection: false,
                enableCellEditOnFocus: true,
                jqueryUITheme: true,
                columnDefs: 'colDefs'
            };

            var myCellEditableTemplate = "<input ng-class=\"'colt' + col.index\" ng-input=\"COL_FIELD\" ng-model=\"COL_FIELD\" ng-blur=\"updateEntity(col, row)\"/>";

            $scope.colDefs = [
                    {field: 'group'},
                    {field: 'user'},
                    {field: 'id', displayName: 'ID', editableCellTemplate: myCellEditableTemplate},             
                    {field: 'last_login_date'},
                    {field: 'status'}
                    ];

            $scope.updateEntity = function (column, row) {
                // code for saving data to the server next...
            }
        });
4

1 に答える 1