1.学习EXTJs 必须一如既往的坚持编程的 严谨仔细,缺一个符号也会造成脚本功能不能实现,比如:
Ext.onReady(function(){
Ext.extend(Person,Ext.util.Observable,{
info:function(event){
return this.name+'is'+event+'ing.';
}
});
var person = new Person('yonysun');
person.on('walk',function(){
Ext.Msg.alert('event',person.name+'走啊走啊走啊...');
});
person.on('eat',function(breakfast,lunch,supper){
Ext.Msg.alert('event',person.name+'需要吃'+breakfast+lunch+supper+'...');
});
person.on('sleep',function(time){
Ext.Msg.alert('event',person.name+'从'+time.format('H')+'点开始睡觉...');
});
});
Ext.onReady(function(){ -----------------function后面必须跟()!
每一个小括号后面都要有" ; " 否则 报错!
问题: Person = function(name){
this.name=name;
this.addEvents('walk','eat','sleep');
};>>>>此处的大括号后面不加标点或加","";"都好用why?<<<<
Ext.extend(Person,Ext.util.Observable,{
info:function(event){
return this.name+'is'+event+'ing.';
}
});
2.Ext.get('id')取得Html元素后,怎样控制其CSS元素及动作?
如下代码所示 主要用DOM控制:
divd.on('mouseover',function(){ //divd.dom.style.display='none'; divd.dom.style.backgroundColor='E88E88'; }); divd.on('mouseout',function(){ //divd.dom.style.display='block'; divd.dom.style.backgroundColor='DBDBDB'; });
3.on('xxx',function(){}); 已验证有click/mouseover/mouseout keypress mousedown 不确定