【发布时间】: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;
};
【问题讨论】:
标签: angularjs ag-grid bootstrap-typeahead