日期:2014-05-16  浏览次数:20642 次

easyui datagrid 自适应问题
本帖最后由 fengxing_2 于 2012-11-13 17:53:01 编辑

按网上说的

fitColumns: true,
width: $(this).width() * 0.067
onresize="javascript:$('#queryClueTableList').datagrid('resize')


但我设置完后,页面开始显示正常,然后最大化或最小化显示就出问题了

最小化


最大化显示


最大化和最小化来回切换,则后边几列就显示有问题,最小化后边几列看不到,最大化后边多出一块空白,而且空白随切换次数的增加而增大

js 代码

/**
 * 初始化table
 */
function initClueTables(){

    $('#queryClueTableList').datagrid({
        width: '100%',
        height: 272,
        loadMsg: 'loading',
        queryParams: {},
//fit:true,
        fitColumns: true,
        //奇偶行使用不同背景色
        striped: true,
        columns: [[{
            field: 'oid',
            title: '编号',
            width: 0,
            //隐藏此列
            hidden: true
        }, {
            field: 'no',
            title: '线索编号',
            width: $(this).width() * 0.067,
            //添加超级链 
            formatter: function(value, rowData, rowIndex){
                //function里面的三个参数代表当前字段值,当前行数据对象,行号(行号从0开始)
                //获取当前行的id
                var hh = "clueDetail.html?oid=" + rowData.oid;
                return "<a href='" + hh + "' target='_blank'>" + value + "</a>";
            }
        }, {
            field: 'name',
            title: '线索姓名',
            width: $(this).width() * 0.067
        }, {
            field: 'cname',
           &n