dojox.grid.DataGrid隐藏/禁用网格的标题

问题描述

| 我需要一个选项来隐藏来自dojox.grid.DataGrid网格的标题。 没有找到任何东西。 我感谢任何信息!     

解决方法

        我在dojo 1.6中使用(可能从dojo 1.3开始就可以使用)
#myGrid .dojoxGridHeader  { display:none; }
    ,        您可以使用CSS: .dojoxGrid-header {display:none; } 该解决方案取自: http://dojotoolkit.org/reference-guide/dojox/grid/DataGrid.html#hiding-the-headers-of-a-grid     ,        您可以在数据网格的后端进行连接。然后找到创建的headerGrid元素 然后将样式显示设为无。
 //workaround the grid calls postrender after
                            //the component is at the dom.
                            //so then i can change the style to reset the header to invisible
                            dojo.connect(grid,\"postrender\",function(){
                                  var headerGrid =this.domNode.firstElementChild;
                                    headerGrid.style.display=\"none\";
                            });
    ,        我建议切换到使用新的和改进的dgrid而不是datagrid,它要好得多! 隐藏标头的设置是属性\'showHeader \',它是一个布尔值。 请查看此dgrid教程,该教程将指导您定义包括\'showHeader \'的网格结构。