【问题标题】:Typeahead with ag-Grid使用 ag-Grid 提前输入
【发布时间】:2018-01-12 22:50:15
【问题描述】:

我正在尝试使用 Angular 1 在 ag-Grid 中实现 typeahead。ag-Grid 文档站点中显示的 typeahead 实现使用的是 Angular 2 typeahead ng2-typeahead。

由于我正在开发的应用程序是基于 Angular 1.5 的,我尝试使用单元编辑器实现 Angular 预输入 (ui.bootstrap.typeahead)。不知何故,它似​​乎在网格中不起作用。我试图提前输入的列是“Release”。我创建的单元格编辑器是“ReleaseEditor”。我正在使用实时 JSON 服务来获取数据。如果有人能帮我解决这个问题,那就太好了。

已创建单元格编辑器

function ReleaseEditor() {
}

ReleaseEditor.prototype.init = function (params) {
    this.eInput = document.createElement('input');
    this.eInput.setAttribute("typeahead", "suggestion for suggestion in cities($viewValue)");
    this.eInput.setAttribute("typeahead-wait-ms", "300");
    this.eInput.setAttribute("ng-model", "result");
    this.eInput.value = params.value;

};

ReleaseEditor.prototype.getGui = function () {
    return this.eInput;
};

ReleaseEditor.prototype.afterGuiAttached = function () {
    this.eInput.focus();

};

ReleaseEditor.prototype.getValue = function () {
    return this.eInput.value;
};

This is the link to the plnkr.

【问题讨论】:

    标签: angularjs ag-grid bootstrap-typeahead


    【解决方案1】:

    gridOptions 对象上设置angularCompileRows:true,它现在可以工作了。我已经更新了 plnkr 下的工作演示, http://plnkr.co/edit/sbM5kewn8mD0w8qkv5ZO?p=preview

    【讨论】:

      猜你喜欢
      • 2017-04-13
      • 2020-09-26
      • 2016-05-11
      • 2019-08-15
      • 2017-01-24
      • 2020-03-31
      • 2018-08-25
      • 2020-03-07
      • 2018-06-25
      相关资源
      最近更新 更多