ext笔记2
5.Ext panel html属性引入
html:'<iframe src="../../js/secospace/patchmgr/jsPie.jsp?one=10&two=10&three=80" frameborder="0" width="158" height="165"></iframe>'
6.监听ENTER键WebRoot\js\common\ux\orgAccountPanel.js
{
xtype : 'textfield',
id : 'searchWin_ipSegment_ipSegmentName',
name : 'name',
width : 100,
listeners : {
'specialkey' : function(f, e) {
if (e.getKey() == e.ENTER) {
var name = Ext.getCmp('searchWin_ipSegment_ipSegmentName').getValue();
var tmpGrid = Ext.getCmp('searchWin_ipSegment_grid');
var store1 = tmpGrid.getStore();
store1.baseParams = {
name : name,
permission : Ext.operationCode
};
store1.load( {
params : {
start : 0,limit : tmpGrid.getBottomToolbar().pageSize
}
});
}
}
}
}
方法2
text:"登录",
formBind:true,
id:"loginBtn",
doFormSubmit: function() {}
keys:[{
key : Ext.EventObject.ENTER,
fn : function(){
Ext.getCmp('loginBtn').doFormSubmit();
}
}]
7.表格的渲染
synorgcm = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
new Ext.grid.CheckboxSelectionModel(),
{
header: local.secospace.sysmgr.licenses.CertificatePanel.sk_cao,
dataIndex : '',
renderer : synorgopertor
}
);
function synorgopertor(v,p,r) {
return common.ux.GridUtil.imageButtons([
{
src: '../../images/modify.gif',
url:'secospace/crlSynAction!getAllCRLFiles.action',
replaceimg: '../../images/modify1.jpg',
tip: local.secospace.sysmgr.licenses.CertificatePanel.sk_bianji,
click: 'secospace.sysmgr.licenses.synpanel.ModifySynWin.showModifyCrlSyn(\''+r.get("id") +'\');'
},
{
src: '../../images/timer.gif',
url:'secospace/crlSynAction!getAllCRLFiles.action',
replaceimg: '../../images/modify1.jpg',
tip: local.secospace.sysmgr.licenses.CertificatePanel.sk_tongbushezhi,
click: 'secospace.sysmgr.licenses.CertificatePanel.synpanel.modifyPeriodWin(\''+r.get("id") +'\');'
}
]);
}
1. renderer:function(value, cellmeta, record, rowIndex, columnIndex, store){
2.
3. }
4. 1.value是当前单元格的值
5. 2.cellmeta里保存的是cellId单元格id,id不知道是干啥的,似乎是列号,css是这个单元格的css样式。
6. 3.record是这行的所有数据,你想要什么,record.data["id"]这样就获得了。
7. 4.rowIndex是行号,不是从头往下数的意思,而是计算了分页以后的结果。
8. 5.columnIndex列号太简单了。
9. 6.store,这个厉害,实际上这个是你构造表格时候传递的ds,也就是说表格里所有的数据,你都可以随便调用,唉,太厉害了