ExtJs 相关

1.Ext.Ajax.request

Ext.Ajax.request({
    url: "url.action",
    params: {},
    success: function(response){
       var result = eval('(' + response.responseText + ')');
       if(result.success){
    	   alert("success")
       }else{
    	   alert("fail");
       }
    }
});

var task = new Ext.util.DelayedTask(function(){
	btn.setDisabled(false);
});
task.delay(10000);

 

2.Ext延迟执行任务

var task = new Ext.util.DelayedTask(function(){
	btn.setDisabled(false);
});
task.delay(10000);

 

3.Form.load

form.getForm().load({
	url:'url.action',
	method:'post',
	params:{
		id:id
	},
	success:function(form,action){
		
	},
	failure:function(form,action){
		
	}
});

 4.Form.submit

form.submit({
	success : function(form, action) {

	},
	failure : function(form, action) {
	}
});

 

5.查询Store可以指定查询第几页

 

 
Ext.data.Store
loadPage( Number page, Object options )
Loads a given 'page' of data by setting the start and limit values appropriately. Internally this just causes a normal load operation, passing in calculated 'start' and 'limit' params

Parameters

  • page : Number

    The number of the page to load

  • options : Object

    See options for load

 

//如回到首页
store.loadPage(1);

 

 6.Store中的Json附带除root和totalProperty以外的其他信息

  

  Java端将otherProperty属性放入Json中,ExtJs如下写

  

Ext.create('Ext.data.Store', {
	storeId : 'store',
	model : 'model',
	pageSize : 20,
	proxy : {
		type : 'ajax',
		url : 'url.action',
		reader : {
			type : 'json',
			root : 'root',
			totalProperty : 'count',
			otherProperty: 'otherProperty'
		}
	}
});

 

如下方式可获取

 

store.getProxy().getReader().jsonData.otherProperty

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值