bootstrap-ui-datetime-picker icon indicating copy to clipboard operation
bootstrap-ui-datetime-picker copied to clipboard

custom buttonBar is error:TypeError: Cannot read property 'show' of undefined

Open Lucy1024 opened this issue 8 years ago • 2 comments
trafficstars

the example is the same question html: <input type="text" class="form-control" datetime-picker="mediumDate" ng-model="ctrl.picker12.date" is-open="ctrl.picker12.open" enable-time="false" button-bar="ctrl.picker12.buttonBar" /> js: this.picker12 = { date: new Date(), buttonBar: { show: true, now: { show: true, text: 'Now!' }, today: { show: true, text: 'Today!' }, clear: { show: false, text: 'Wipe' }, date: { show: true, text: 'Date' }, time: { show: true, text: 'Time' }, close: { show: true, text: 'Shut' } } }; error: TypeError: Cannot read property 'show' of undefined at m.$scope.doShow (datetime-picker.js:338)

Lucy1024 avatar Jun 13 '17 01:06 Lucy1024

you need to specify the cancel button too in the buttonBar config:

 cancel: {
                show: true,
                text: 'Cancel',
                cls: 'btn-sm btn-default'
            }

markhbrown avatar Jul 07 '17 13:07 markhbrown

it works ,thanks

Lucy1024 avatar Jul 14 '17 07:07 Lucy1024