2013-06-25 37 views
0

我有一個樹形網格面板上的動作列定義,我想隱藏文件夾上的動作圖標,但在葉節點顯示不同的圖標,我成功地做到了,但是,當我應用 'x-hide-display'風格時,我也注意到列本身被隱藏起來,我只想在每列中顯示圖標。 感謝刪除動作列圖標,但保持列可見

this.columns = [{ 
      xtype: 'treecolumn', //this is so we know which column will show the tree 
      text: 'Folder', 
      flex: 1, 
      sortable: true, 
      dataIndex: 'folder' 
     },{ 
      text: '', 
      width: 20, 
      menuDisabled: true, 
      xtype: 'actioncolumn', 
      tooltip: 'View Chats', 
      align: 'center', 
      items:[{ 
       icon: 'resources/images/comment.png', 
       getClass: function(value, metaData, record){ 
        if(record.raw.leaf) 
         metaData.css = 'x-grid-icon' 
        else 
         metaData.css = 'x-hide-display'; 
       } 
      }] 
     },{ 
      text: '', 
      width: 20, 
      menuDisabled: true, 
      xtype: 'actioncolumn', 
      tooltip: 'View Alerts', 
      align: 'center', 
      items:[{ 
       icon: 'resources/images/alert.png', 
       getClass: function(value, metaData, record){ 
        if(record.raw.leaf) 
         metaData.css = 'x-grid-icon' 
        else 
         metaData.css = 'x-hide-display'; 
       } 
      }] 
     },{ 
      text: '', 
      width: 20, 
      menuDisabled: true, 
      xtype: 'actioncolumn', 
      tooltip: 'Favorite', 
      align: 'center', 
      items:[{ 
       icon: 'resources/images/favorites.png', 
       getClass: function(value, metaData, record){ 
        if(!record.raw.leaf) 
         metaData.css = 'x-grid-icon' 
        else 
         metaData.css = 'x-hide-display'; 
       } 
      }] 
     },{ 
      text: '', 
      width: 20, 
      menuDisabled: true, 
      xtype: 'actioncolumn', 
      tooltip: 'Share', 
      align: 'center', 
      items:[{ 
       icon: 'resources/images/share.png', 
       getClass: function(value, metaData, record){ 
        if(!record.raw.leaf) 
         metaData.css = 'x-grid-icon' 
        else 
         metaData.css = 'x-hide-display'; 
       } 
      }] 
     }] 

I want the icons on each column not under the folder icons

回答

1

它非常簡單,而不是添加X-隱藏顯示添加自己的CSS類:

.hide-icon img{ visibility: hidden !important } 

這就是全部。 我們添加了img,因爲您只想隱藏圖像圖標而不是隱藏單元格本身,如果您在將鼠標移過該行時未添加img,您會注意到隱藏單元格不會更改灰色背景顏色。

1

幫我:

if(!record.raw.leaf){ 
    return 'x-grid-icon'; 
}else{ 
    return 'x-hidden'; 
} 
相關問題