以下是我正在使用的代码
1.我在 angular slickgrid 表中添加了一个新行,代码如下 const newItem = { id: this.dataset.length + this.index, roleName: '' };
// add the item to the grid
this.angularGrid.gridService.addItem(newItem);
- 以下是列定义
this.columnDefinitions = [ { id: 'roleName', name: 'Role *', field: 'roleName', sortable: true, type: FieldType.string, filterable: true, width: 80, editor: { model: Editors. singleSelect, enableRenderHtml: true, collection: ['1','2', '3'], placeholder: '选择一个选项', collectionSortBy: { property: 'label' }, } } ]
3.GridOptions有:
this.gridOptions = { enableAutoResize: true,
enableCellNavigation: true, editable: true, autoEdit: true, enableColumnPicker: true, };
但是可以看到当我在表中添加新行并且如果我快速单击选择元素然后它会在几秒钟内打开一个下拉列表然后它会自动关闭。