Welcome

首页 / 脚本样式 / ExtJS / ExtJS技巧笔记

ExtJS技巧笔记2011-10-29 javaeye yourgameJs代码

Ext.fly(grid.getView().getRow(0)).slideIn("t"); //选择第一条有从上往下的插入效果
Ext.fly(grid.getView().getRow(0)).frame("#cadaf9",3);//选择一条记录带蓝色光晕效果
enableKeyEvents:true //激活键盘事件 ,TextField 的键盘事件默认是关闭的
cmp.el.mask("正在发送...", "x-mask-loading"); //给组件上遮罩
cmp.el.unmask(); //隐藏遮罩
this.previousSibling();//当前组件的前一个组件(同一个容器)
this.nextSibling(); //当前组件的后一个组件(同一个容器)

//给组件增加快捷键(CTRL + 回车)
{
xtype: "textarea",
listeners: {
"render": function (input) {
new Ext.KeyMap(input.getEl(), [{
key: 13,
ctrl: true,
fn: function () {},
scope: this
}]);
}
}
}

Java代码

//在分页组件前面添加组件
var page = new Ext.PagingToolbar({
store: store,
displayInfo: true,
pageSize: 10
});
page.insert(0, "-");
page.insert(0, { //添加一个日期组件
xtype: "datefield",
name: "chatdate",
format: "Y-m-d",
value: new Date()
});

效果如图如下