1 Ext 的grid重新加载数据:
gridEj.store.proxy=new Ext.data.HttpProxy({
url:
});
gridEj.store.load({params:{start:0, limit:10}});
2 数据加载后,选择所有数据。实现的功能:页面加载完毕后立即选择所有数据。
dataStore.on('load',function(){
;
}) ;
3 grid 编辑后验证
grid.on('afteredit',function(e){
e.row;
e.column;
e.originalValue;
e.value;
});
4 Ext form 的提交
var gridForm = new Ext.BasicForm(Ext.get("form2"), {
fileUpload : true
});
var dwdm = $('dwdm').value;
var zdwdm = $('zjdwdm').value;
var dwdm = $('dwdm').value;
var zjfs =$('zgzjzjyxdm').value;
var js ="[" ;
for(var i = 0, len = dwStore.getCount(); i < len; i++){
if(dwStore.getAt(i).data['indoor'] == true){
js += Ext.util.JSON.encode(dwStore.getAt(i).data); //Ext.util.JSON.encode(dwStore.getAt(i).data);
if (i != len - 1) {
js += ",";
}
}
}
js+="]";
var options={
waitMsg: '正在处理中,请等待...',
waitTitle: '进度条',
reset: false,
url: '/newsx/zzcy/plzjry.do?method=saveForZzcy',
method:'POST',
success : function(form, action) {
messageObj.okMessage( {
title : '操作成功',
text : action.result.msg
});
},
failure : function(form, action) {
messageObj.errorMessage( {
title : '操作失败',
text : action.result.msg
});
},
params:{json:js,dwdm:dwdm,zdwdm:zdwdm,zjfs:zjfs},
scope: zzcyForm
}
zzcyForm.submit(options) ;
后台:
response.getWriter().write(
"{success:true}");
response.getWriter().write(
"{failure:true,msg:'个人缴费帐号已经在系统中存在,请检核实帐号后再输入!'}");
return null ;
5 Ext Ajax提交
function ajax(adwdm) {
if (adwdm == null && adwdm == '') {
return;
}
var st = adwdm;
Ext.Ajax.request( {
url : '/newsx/dwxxbgcx.do?method=ajax',
success : function(result) {
if (result.responseText == '')
return;
if (result != null || result.responseText != '') {
messageObj.errorMessage( {
title : '操作失败',
text : result.responseText
});
return;
}
},
reset : false,
params : {
param : st
},
});
}