Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用数据表格②以后,再加上table的很多功能就出现bug,比如table-condensed、table-auto #183

Closed
zmb4973992 opened this issue Dec 26, 2020 · 1 comment

Comments

@zmb4973992
Copy link

单独使用数据表格②没发现什么问题,
但是使用数据表格②以后,再附加table的一些功能,就出问题了。
比如使用table-auto调整列宽,会全部缩到很小,无法调整;
1

table-condensed似乎失效;

莫非这两个功能是相互冲突的?期待有个说明或者修复,感谢作者的付出!

@catouse
Copy link
Collaborator

catouse commented Jun 16, 2021

数据表格2所支持的自动列宽是需要自己定义每列所占百分比来调整,无法像传统表格那样根据内容来进行调整。当启用自适应列宽功能时,所有没有指定宽度的列会平分剩余的水平空间,但仍然可以通过配置为列宽设置一个权值,使得拥有更大权值的列获得更多的空间。权值通过 列定义的 width 属性设置,必须小于 1。

$('#myDataGrid').datagrid({
    dataSource: {
        cols:[
            {name: 'time', label: '对局时间', width: 132},
            {name: 'hero', label: '英雄', width: 134},
            {name: 'action', label: '动作', width: 109},

            // target 列自适应,占据剩余列宽的 1/4
            {name: 'target', label: '目标', width: 0.25},

            // desc 列自适应,占据剩余列宽的 3/4
            {name: 'desc', label: '描述', width: 0.75}
        ],
    }
});

第二个问题,因为行高需要预先设定,所以也是不支持普通表格的 table-condensed 类。

@catouse catouse closed this as completed Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants