小编Ant*_*ruk的帖子

在ui-grid中使用Angular Bootstrap datepicker(unstable 3.0.0)

我在ui-grid中使用AngularJS Bootstrap datepicker(3.0.0 - 不稳定)

我通过自定义cellTemplate(ui-grid)实现了datepicker:

{
      field: 'Wiedervorl',
      displayName: 'Wiedervorl.',
      enableCellEdit: true,
      enableCellEditOnFocus: true,
      enableHiding: false,
      cellTemplate: '<div><input ng-model="row.entity.Wiedervorl" ng-change="grid.appScope.addModifyFlag(row.entity)" ng-click="opened = true;" datepicker-popup="dd.MM.yyyy" is-open="opened" datepicker-options="grid.appScope.dateOptions" datepicker-append-to-body="true" type="text" /></div>',
      cellFilter: 'date',
      cellClass: function () {
        return 'text-left';
      },
      filter: {
        placeholder: 'date',
        condition: uiGridConstants.filter.CONTAINS
      },
      width: '7%'
    },
Run Code Online (Sandbox Code Playgroud)

在datepicker输入内部有一个标记'open',它与该输入元素的一个实例(datepicker实例)完全隔离.

问题是,在另一行中再打开一个日期选择器之后,前一个没有关闭,并且可以同时打开多个日期选择器.

在此输入图像描述

我试图在输入中添加"ng-blur",但是当datepicker打开时,它会执行.

任何想法,如何完成UI-Grid内部之前的datepicker实例的关闭?一次只能激活一个.

谢谢

angularjs angular-ui-bootstrap

9
推荐指数
3
解决办法
1万
查看次数

标签 统计

angular-ui-bootstrap ×1

angularjs ×1