【问题标题】:How to turn off the dojo dataGrid outter border and the gridline between each row?如何关闭dojo dataGrid外边框和每行之间的网格线?
【发布时间】:2012-06-16 11:56:28
【问题描述】:

我使用以下代码使用 dojo dataGrid 呈现表格。 但是,我需要关闭每个单元格周围的边界线(水平和垂直) 完全地。 你能告诉我如何做到这一点吗? (例如,我应该为此定义额外的 CSS 吗?)

非常感谢!

dojo.ready(function() {
    var layout = [
        {type: "dojox.grid._CheckBoxSelector"},
        [
            { name: "Photo", field: "Photo", width: "10%",
                formatter: function(field){
                    return "<img src='/images/test.gif' WIDTH=45 HEIGHT=45>";
                }   
            },

            { name: "Summary", fields:["column1", "column2", "column3", "column4"],editable:true,width: "80%" ,
                formatter: function(fields){
                    var column1 = fields[0],
                    column2 = fields[1],
                    column3 = fields[2],
                    column4 = fields[3];

                    return "<h4 class='namelink'><a href='javascript:;'>" +column1+ "  "+ column2 + "</a></h4>" + "<div class='namelink'> <a href='javascript:;'>"+ "Another Name" + "</a></div>" + column3 + "<br>" + "<div class='addresslink'> <a href='javascript:;'>"+column4+"</a> </div>";
                }
            }
        ]
    ]

     var mygrid = new dojox.grid.DataGrid({
        id: "gridId",
        store: store,
        autowidth:"true", 
        rowselector:"15px",
        keepRows: "30",
        rowsPerPage: "10",
        style:"height:300px",
        structure: layout},"gridContainer");    
    mygrid.startup();
    dojo.connect(mygrid, "onApplyEdit", function(row){
        store.save();
    });
});

【问题讨论】:

    标签: datagrid dojo


    【解决方案1】:
    .dojoxGridCell {
      border: none !important;            
    }
    

    编辑:仅顶部和底部

    .dojoxGridCell {
      border-width: 1px 0 !important;
    }
    

    【讨论】:

    • 您好,感谢您的快速回复。有没有办法关闭两个垂直边框但保留顶部+底部边框?
    猜你喜欢
    • 2012-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-20
    • 2021-04-04
    • 2012-06-08
    • 2011-07-09
    相关资源
    最近更新 更多