【问题标题】:Date picker in ng-grid is not working with IE10ng-grid 中的日期选择器不适用于 IE10
【发布时间】:2015-03-11 15:33:29
【问题描述】:

        $scope.idCardValidityTracker = {
            data: 'data',                          //Test data
            enableCellEditOnFocus: true,
            enableRowSelection: false,
            columnDefs: [{ field: 'idCardNumber', displayName: 'ID Card Number', visible: true },
                        { field: 'validFromDate', displayName: 'Valid From', enableCellEditOnFocus: true, enableCellSelection: true, editableCellTemplate: '</b><input type="date" value="MM-dd-yyyy"  ng-class="' + 'colt' + '+ $index"  ng-input="COL_FIELD" ng-model="COL_FIELD"/>', cellFilter: 'date:\'MM-dd-yyyy\'' },
                        { field: 'validToDate', displayName: 'Valid To', enableCellEditOnFocus: true, enableCellSelection: true, editableCellTemplate: '</b><input type="date" value="MM-dd-yyyy" ng-class="' + 'colt' + '+ $index"  ng-input="COL_FIELD" ng-model="COL_FIELD" />', cellFilter: 'date:\'MM-dd-yyyy\'' }]
        };
<style>
 .gridStyle {
        max-height: 170px;
        resize: horizontal;
        border: 1.5px ridge #fdfef9;
        margin-top: 5px;
        width: auto;
        margin-left: 2px;
        resize: both;
    }

</style>
&lt;div class="gridStyle" ng-grid="idCardValidityTracker" style="text-align:center; align-items:center;"&gt;&lt;/div&gt;

ng-grid 中的日期选择器在 Google chrome 上运行良好,但在 Internet Explorer 10 中却不行。请帮我解决这个问题。

【问题讨论】:

  • 不工作是什么意思?你能做个笨蛋吗?
  • 在 chrome 中,单击日期可编辑单元格后,我会弹出日期选择器。在 Internet Explorer 的情况下,单元格是可编辑的,但在单击日期可编辑单元格后不会弹出任何窗口。

标签: javascript jquery css angularjs ng-grid


【解决方案1】:

日期选择器在 IE 中不起作用

Internet Explorer 不支持日期字段。这就是为什么您的代码无法运行

 <input type="date"> // IE doesn't support 

您也可以使用引导日期选择器,它也可以在 IE 中工作。

http://angular-ui.github.io/bootstrap/#/datepicker

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多