<script type="text/javascript"><script type="text/javascript">
//载入完数据时根据分类类型隐藏grid中的某些列
Ext.onReady(function(){
Ext.getCmp('grid_email_panel').store.on('load',function(store,records,options){
//获取左边树选中的节点
var node = Ext.getCmp('tree_email_panel').getSelectionModel().getSelectedNode();
var text = '';
if(node){//第一次进入未选中节点
text = node.text;
}
//alert(text);
if(text=='收件箱'){//收件箱
Ext.getCmp('grid_email_panel').getColumnModel().setHidden(5,true); //隐藏"收件人"
Ext.getCmp('grid_email_panel').getColumnModel().setHidden(4,false); //显示"发件人"
}else if(text=='发件箱'){//发件箱
Ext.getCmp('grid_email_panel').getColumnModel().setHidden(4,true); //隐藏"发件人"
Ext.getCmp('grid_email_panel').getColumnModel().setHidden(5,false); //显示"收件人"
}else{ //邮件节点
Ext.getCmp('grid_email_panel').getColumnModel().setHidden(4,false); //显示"发件人"
Ext.getCmp('grid_email_panel').getColumnModel().setHidden(5,false); //显示"收件人"
}
});
});
</script>
</script>