javascript - 在 ag-grid 中使用时,Vaadin-combo-box 将数组转换为 [object Object]
问题描述
我在 ag-grid 中使用 Vaadin-combo-box,但不知道为什么数组转换为 [object Object]。
下面是 ag-grid 的代码
columnDefs = [{
headerName: "Students",
field: "studentId",
cellRenderer: this.renderStudentDropdown
}]
renderStudentDropdown(){
const records = [{"id": "123", "title" : "Student 1"},{"id": "456", "title" : "Student 2"}]
let html = `<vaadin-combox-box .items=${templates} .value='${value}' item-label-path="title" item-value-path="id"></vaadin-combox-box>`;
return html
}
在浏览器中渲染后,它不会在下拉列表中显示数据并打印数据,如 [object Object]
解决方案
推荐阅读
- javascript - 如何从具有类似类的 HTML 中获取某些元素(使用 JavaScript)?
- java - 为什么 Selenium 无法识别 WebElement?
- javascript - 错误:当您双击(切换)选择时,Select2 Ajax 多选复选框不会删除(取消选择)
- python - 创建(正常)均值和标准差的 2 层级估计
- python - 从python中的txt文件中提取特定文本
- laravel - 在 Laravel 服务器上发布图片而不是图片链接
- mysql - 如何在续集中为特定值不同的结果编写选择查询
- reactor-netty - 来自发布者的 Reactor-netty http 状态
- mongodb - mongodb删除超过一段时间但没有日期属性的文档
- javascript - 在 React 中将状态变量和方法传递给子组件的更简洁的方法?