EasyUI中,DataGrid中的combobox显示异常问题

上周在项目中,用到了easyUI下DataGrid的Editor属性,是为了创建下拉菜单

   {
                        field: 'Violation',
                        title: '实例1',
                        150,
                        sortable: true,
                        formatter: function (value, row) {
                            return row.ViolationDesc;
                        },
                        editor: {
                            type: 'combobox',
                            options: {
                                data: pipingLevel,
                                valueField: "Violation",
                                textField: "ViolationDesc",
                                editable: false
                            }
                        }
                    }

 但是当切换下拉框选项以后,下拉框中怎么都没有内容显示,即使把官方的例子照搬过来也没有用,后来整整研究了一天也没找到解决方案。

最后求助了组里的大牛帮忙找到了问题。

原因: easyui和bootrap的样式冲突,所导致的问题。只需要在页面中加上这段样式即可。

<style>
    button, input, optgroup, select, textarea {
        color: black;
        font: inherit;
        margin: 0;
    }
</style>

最后感谢东哥帮我解决了这个难题!

原文地址:https://www.cnblogs.com/hobby0524/p/6932480.html