在设置在DataColumn.imageList中的图像列表中,与文本一同显示位于GridStyles.iconIndex的图像。 如果将渲染器的textVisible属性指定为false,就不会显示文本。 通过GridStyles.iconLocation,指定图像的显示位置。 当GridStyles.iconLocation为CENTER时,同样不会显示文本。
当设置列渲染器时,将type指定为"icon"。
grid.setColumns([{
name: "Country",
fieldName: "Country",
width: "80",
imageList: "images1",
renderer: {
type: "icon",
textVisible: false
},
dynamicStyles: "iconStyles2",
styles: {
iconIndex: 0,
iconLocation: "left",
iconAlignment: "center",
iconOffset: 2
},
header: {
text: "textVisible\n=false"
}
},
...
]);