将可折叠图像隐藏到一个网格中

时间:2012-09-17 13:58:55

标签: javascript extjs

正如标题所说我需要从一个网格中隐藏可折叠图像(我在同一个网站中有很多),我不能简单地更改css,因为我的网络中的每个网格都会这样做,我只想那样网格没有背景图片。

我尝试使用background-image: none创建一个css类并更改bodyCssClass,baseCls,cls配置,但我没有获得预期的行为。

有什么想法吗?

编辑1:

GridPanel代码:

var grid = new Ext.grid.GridPanel({
    id: "gridPanel1",
    disableSelection: true,
    frame: true,
    title: "Centers",
    //autoHeight: true,
    height: 415,
    width: 500,
    store: store,
    colModel: new Ext.grid.ColumnModel(items),
    ctCls: 'noCollapsable',
    view: groupingVi,
    sm: selectionMod
});

的CSS:

.noCollapsable{
    background-image: none !important;
}

编辑2:

是的!它与该示例(http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/grid/groupgrid.html)完全相同,但背景图像位于

 <div class="x-grid-group-title">Cuisine: CountryX (Y Items)</div>

我不知道如何在这个结构中使用Ext DomHelper或其他任何东西来改变那些div的css:

<tr id="gridview-1013-hd-CountryX" class="x-grid-group-hd x-grid-group-hd-collapsed">
   <td class="x-grid-cell" colspan="2" style="padding-left:0px;">
      <div class="x-grid-cell-inner">
         <div class="x-grid-group-title">Cuisine: Country X (Y Items)</div>
      </div>
   </td>
</tr>

我可以使用第一个tr来识别其他网格,但正如我所说,我不知道如何访问这些div

1 个答案:

答案 0 :(得分:0)

你可以发布一些代码,因为有更好的方法来实现这一点。但作为猜测。

将以下内容分配给网格时会发生什么

baseCls: 'myClass';

然后在你的CSS中。

.myClass{background-image: none !important;}