初学 Ext.extends

来源:互联网 发布:怎么知道路由器mac地址 编辑:程序博客网 时间:2024/06/11 12:11

<script type="text/javascript">
Ext.onReady(function() {
var win = new com.test.win({
title : 'test1',
width : 200,
height : 300
}).show();
win.ss();
});
</script>

xx.js

Ext.namespace('com.test');
com.test.win = function(config) {
config.title = 'dd';
com.test.win.superclass.constructor.call(this, config);
};


var b1 = new Ext.Button({
text : 'ddd',
width : 150,
listeners : {
click : function() {
alert(1);
}
}
});


Ext.extend(com.test.win, Ext.Window, {
buttons : [ b1 ],
ss : function() {


}
});

0 0