easyui datagrid 设置列宽

<script>
        $(document).ready(function () {
            alert("sdf");
            $('#chaxunjieguo').datagrid({
                columns: [[
                    { field: 'code', title: '时间', fixWidth(0.2), align: 'center' },
                    { field: 'name', title: '名称', fixWidth(0.4), align: 'center' },
                    { field: 'price', title: '附件', fixWidth(0.2), align: 'center' }
                ]]
            });
        });
        function fixWidth(percent) {
            return (document.body.clientWidth - 5) * percent;
        }
    </script>

原文地址:https://www.cnblogs.com/zhang-wenbin/p/5849969.html