这段代码非常经典,我这里给出
Ext.define('app.view.myView', {
extend: 'Ext.panel.Panel',
alias: 'widget.myView',
title: 'My Cool Panel',
html: '<div><a href="#">This link will open a window</a></div><br /> <label for="myInput">Type here: </label><input name="myInput" type="text" value="" />',
initComponent: function(){
var me = this;
me.callParent(arguments);
}
});
Ext.define('app.controller.myController', {
extend: 'Ext.app.Controller',
init: function() {
this.control({
'myView': {
afterrender: function(cmp){
var me = this; //the controller
var inputs = cmp.getEl().select('input'); // will grab all DOM inputs
inputs.on('keyup', function(evt, el, o){
me.testFunction(el); //you can call a function here
});
var links = cmp.getEl().select('a'); //will grab all DOM a elements (links)
links.on('click', function(evt, el, o){
//or you can write your code inline here
Ext.Msg.show({
title: 'OMG!',
msg: 'The controller handled the "a" element! OMG!'
});
});
}
}
});
},
testFunction: function(el) {
var str = 'You typed ' + el.value;
Ext.Msg.show({
title: 'WOW!',
msg: str
});
}
});
越看我就感觉我什么也不是,这个都想不出来。。。啊啊啊啊啊啊啊啊啊
分享到:
相关推荐
基于extjs的.NET3.5控件Coolite 1.0.0.34580 (Preview预览版), *************************************************** * Version 1.0.0 升级日志 * *************************************************** 1. ...
[DefaultValue(1)] public int NumberOfSteps { get; set; } ``` 4. **处理生命周期事件**: 实现Load、PreRender等事件,以在适当的时间点执行回退逻辑。这可能包括检查HTTP上下文,判断是否可以回退,并更新状态。...
public partial class Paging : UserControl { public Paging() { InitializeComponent(); } public delegate void EventPagingHandler(EventArgs e); public event EventPagingHandler EventPaging; ...
包括面向对象特性、集合操作效率、字符串比较、Hibernate映射、编码解码、Spring的IoC、方法参数、抽象类和接口、异常处理、final修饰符、finally块、JSP隐含对象、Servlet参数获取、Filter、Struts2参数获取、HTML...
- **控制 (Control):** JavaScript 是 AJAX 的核心,负责处理用户交互以及发送请求。 - **视图 (View):** DHTML 负责显示数据,通常使用 HTML 和 CSS 来构建界面。 - **模型 (Model):** 数据存储于后端或前端,常用...
- 0000728: Disabled UniEdit does not receive values assigned with Control.Text := Value - 0000720: Tag property for DBGrid Columns - 0000723: DBGrid: numeric column is not aligned to right - ...
<param-value>/WEB-INF/spring/*.xml</param-value> <listener-class>org.springframework.web.context.ContextLoaderListener ``` 这里定义了 Spring 的配置文件位置,并通过 `ContextLoaderListener` ...
-为所有控件增加Focus(覆盖Control默认的Focus函数)和GetFocusReference函数。 -增加示例(other/custom_postback.aspx)(feedback:thebox)。 -如何自定义Javascript脚本和C#处理函数来响应键盘事件。 -为Tree...
-为所有控件增加Focus(覆盖Control默认的Focus函数)和GetFocusReference函数。 -增加示例(other/custom_postback.aspx)(feedback:thebox)。 -如何自定义Javascript脚本和C#处理函数来响应键盘事件。 -为Tree...