File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ __ColumnDef Options__:
4444- `enableCellEdit` (default: `false` for columns of type `'object'`, `true` for all other columns) - `true` will enable
4545 editing and `false` will disable it.
4646- `cellEditableCondition` (default: `true`) Can be set to a boolean or a function that will be called with the cellScope
47- to determine if the cell should be invoked in edit mode.
47+ and triggerEvent to determine if the cell should be invoked in edit mode.
4848- `type` (default: `'string'`) If set to `'number'`, `'boolean'` or `'date'` the default editor provided for editing will be numeric
4949 or boolean or date editor respectively. If set to `'object'` the column will not be editable by default. Be aware that this
5050 `type` column is also used for other purposes within ui-grid, including the sorting logic.
Original file line number Diff line number Diff line change 147147 * If false, then editing of cell is not allowed.
148148 * @example
149149 * <pre>
150- * function($scope){
151- * //use $scope.row.entity and $scope.col.colDef to determine if editing is allowed
150+ * function($scope, triggerEvent ){
151+ * //use $scope.row.entity, $scope.col.colDef and triggerEvent to determine if editing is allowed
152152 * return true;
153153 * }
154154 * </pre>
209209 * @description If specified, either a value or function evaluated before editing cell. If falsy, then editing of cell is not allowed.
210210 * @example
211211 * <pre>
212- * function($scope){
213- * //use $scope.row.entity and $scope.col.colDef to determine if editing is allowed
212+ * function($scope, triggerEvent ){
213+ * //use $scope.row.entity, $scope.col.colDef and triggerEvent to determine if editing is allowed
214214 * return true;
215215 * }
216216 * </pre>
592592 }
593593 }
594594
595- function shouldEdit ( col , row ) {
595+ function shouldEdit ( col , row , triggerEvent ) {
596596 return ! row . isSaving &&
597597 ( angular . isFunction ( col . colDef . cellEditableCondition ) ?
598- col . colDef . cellEditableCondition ( $scope ) :
598+ col . colDef . cellEditableCondition ( $scope , triggerEvent ) :
599599 col . colDef . cellEditableCondition ) ;
600600 }
601601
732732 return ;
733733 }
734734
735- if ( ! shouldEdit ( $scope . col , $scope . row ) ) {
735+ if ( ! shouldEdit ( $scope . col , $scope . row , triggerEvent ) ) {
736736 return ;
737737 }
738738
You can’t perform that action at this time.
0 commit comments