alexeypt / ui-grid-edit-datepicker

This directive provides ability to use Bootstrap datepicker for editing dates in UI Grid
MIT License
13 stars 3 forks source link

ng-disabled #10

Open arashberlin opened 7 years ago

arashberlin commented 7 years ago

Hi, thank you for your work and time to provide this directive.

How can I enable "ng-disabled" for datepicker? I need to disable some cells and what to pass a bool value to the directive.

Many thanks

Arash

Joiler commented 7 years ago

@arashberlin, but, maybe, if you need to disable datepicker for some cells (i.e. editing of some cells), it's better to disable editing of such cells at all in gridOptions (cellEditableCondition parameter). For instance:

{ name: 'Date',
                field: 'date',
                cellFilter: 'textDate:"M/d/yyyy"',
                cellEditableCondition: function($scope) {
                    return $scope.row.entity.id > 40;
                },
                editableCellTemplate: '<div><form name="inputForm"><div ui-grid-edit-datepicker date-format="yy-MM-dd" datepicker-options="datepickerOptions" ng-class="\'colt\' + col.uid"></div></form></div>'

Does it work for you?

arashberlin commented 7 years ago

Hi there. Yes this help be out. I did not know about the cellEditableCondition. Many thanks. That help me out

2017-04-08 21:13 GMT+02:00 Joiler notifications@github.com:

@arashberlin https://github.com/arashberlin, but, maybe, if you need to disable datepicker for some cells (i.e. editing of some cells), it's better to disable editing of such cells at all in gridOptions (cellEditableCondition parameter). For instance:

{ name: 'Date', field: 'date', cellFilter: 'textDate:"M/d/yyyy"', cellEditableCondition: function($scope) { return $scope.row.entity.id > 40; }, editableCellTemplate: '

'

Does it work for you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Joiler/ui-grid-edit-datepicker/issues/10#issuecomment-292739357, or mute the thread https://github.com/notifications/unsubscribe-auth/ALzs1dodvmqq6o18s3aEd57Cik4LH8FTks5rt9x2gaJpZM4M1zru .