jQuery MiniUI

标题: 请问下拉菜单选项内容可以带图片吗? [打印本页]

作者: ljzzhuche    时间: 2019-3-3 18:06:58     标题: 请问下拉菜单选项内容可以带图片吗?

请问下拉菜单选项内容可以带图片吗?例如下面的效果:

作者: dforce    时间: 2019-3-4 10:03:23

可以,combobox有ondrawcell事件,可以绘制自定义内容
ondrawcell="onDrawCell"
function onDrawCell(e) {
            var item = e.record, field = e.field, value = e.value;
            //组织HTML设置给cellHtml
            e.cellHtml = '<span style="color:red;">'+value+'</span>';   
        }
        
作者: 13407315255    时间: 2019-3-4 15:18:39

dforce 发表于 2019-3-4 10:03
可以,combobox有ondrawcell事件,可以绘制自定义内容
ondrawcell="onDrawCell"
function onDrawCell(e) {

这样好像会导致emptyText不显示
作者: 哎呀    时间: 2019-3-4 15:44:15

13407315255 发表于 2019-3-4 15:18
这样好像会导致emptyText不显示

图片需要设置高度宽度等值,不然就显示不了




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2