资源描述:
《EXT各个控件属性(3)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、一、如何同步调用Ajax远程数据// 同步方式,API不直接提供,获取XHR的conn的引用即可 var url = "myApp/getUserList.do"; var conn = new Ext.data.Connection()conn; conn.open("POST", url, false); conn.send(null); var json = Ext.decode(conn.responseText); // 异步方式,这是常用的方式 new Ext.data.Connection().request({ // 此即
2、是Ext和Struts交互的关键 url: 'myApp/getUserList.do', params: {id: 10001,name: '测试'}, failure: requestFailed, success: requestSuccessful } //同步方式,API不直接提供,获取XHR的conn的引用即可varurl="myApp/getUserList.do";varconn=newExt.data.Connection()conn;conn.open("POST",url,false);conn.
3、send(null);varjson=Ext.decode(conn.responseText);//异步方式,这是常用的方式newExt.data.Connection().request({//此即是Ext和Struts交互的关键url:'myApp/getUserList.do',params:{id:10001,name:'测试'},failure:requestFailed,success:requestSuccessful}二、全局性、强制指定HTTP方法(动词)viewplaincopytoclipboardprint?Ext.Ajax.on('b
4、eforerequest', function(){ arguments[1].method = 'GET' // or 'POST''PUT''DELETE' }); Ext.Ajax.on('beforerequest',function(){arguments[1].method='GET'//or'POST''PUT''DELETE'});三、怎么对form中的textfield赋值viewplaincopytoclipboardprint?Ext.getCmp("TextField_id").setValue("value")
5、; Ext.getCmp("TextField_id").setValue("value");四、布局一些已知的限制'fit'的layout中items只能放一个子组件,即使放多个,也只会显示第一个。而且aotuHeight属性页不能和fit一起使用;'border'布局方式中,分为东西南北中五个region,其中center是自动计算大小的。而'south','north'只能设置高度,'west','east'只能设置宽度。(by佚名网友)五、返回当前类的静态成员的另外一种方法:constructor.prototypeviewplaincopytoc
6、lipboardprint?/** * @class xyj.Controlller * A Model class represents and manages a tables in a database. * Model instances represent individual records in the table. * Models follow the ‘Active Record’ design pattern for object-relational mapping. */ xyj.data.Controlller = fun
7、ction(config){ this.parents = []; this.children = []; Object.apply(this, config); Array.each(this.belongTo, this.assignElment, {scope:this, which: 0}); Array.each(this.hasMany, this.assignElment, {scope:this, which: 1}); }; xyj.data.Cont
8、rolller.prot