如何在SlickGrid中自动调整列的大小? [英] How do I autosize the column in SlickGrid?

查看:380
本文介绍了如何在SlickGrid中自动调整列的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望slickgrid根据最宽的内容或标题文本(以较宽的为准)自动调整列的大小.简而言之,当涉及到列大小调整时,我希望它模拟常规HTML表的默认行为.我该如何在slickgrid中做到这一点?

I want slickgrid to autosize the columns based on the widest content or header text - whichever is wider. In simpler terms, I want it to simulate the default behavior of regular HTML tables when it comes to column sizing. How can I do it in slickgrid?

推荐答案

构造选项时,可以使用forceFitColumns: true

When constructing your options, you can use forceFitColumns: true

var options = {
    enableCellNavigation: true,
    forceFitColumns: true
};

这将使列填充网格div的整个宽度.

This will make the columns fill the entire width of your grid div.

这篇关于如何在SlickGrid中自动调整列的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆