javascriptangularjsangularui-grid

ui-grid second col can edit or not judge by first col 's value


enter image description here

1.The request is weather the 'tax_amount' column need to be filled in or not decide by the first column: 'tax_type', ex: tax_type = 1, tax_amount can edit, tax_type = 2, tax_amount can't edit.

can ui-grid do this requirement ?


Solution

  • cellEditableCondition: function ($scope) {
        return $scope.row.entity.bill_type_id === 'aaa';
    }
    

    It's solved!