52,797
社区成员
发帖
与我相关
我的任务
分享
//评级
createForm:function(){
var formPanel=new Ext.form.FormPanel({
frame:true,
labelWidth:70,
labelSeparator:':',
labelAlign:'right',
layout:'column',
items:[
{
layout: 'form',
items: [new Ext.form.Radio({boxLabel:'优 ',inputValue:1,id:'grade',name:'grade',checked:true})]
},
{items: [new Ext.form.Radio({boxLabel:'良 ',inputValue:2,id:'grade',name:'grade'})]},
{items: [new Ext.form.Radio({boxLabel:'差 ',inputValue:3,id:'grade',name:'grade'})]},
],
buttons:[{text:"保存",
handler:this.save,
scope:this},
{text:"关闭",
handler:this.closeWin,
scope:this}
]
});
return formPanel;
},
save:function()
{
if(this.grid.selModel){
var store=this.store;
var quaUrl=this.quaUrl;
var records = this.grid.selModel.getSelections();//得到被选择的行的数组
var recordsLen = records.length;//得到行数组的长度
var id = '';
for(var i=0;i<recordsLen;i++){
var recordid=records[i].id;
if(i!=0){
id +=','+recordid ;
}else{
id += recordid ;
}
}
Ext.MessageBox.confirm('系统提示信息', '确定要评级所选的记录吗?', function(buttonobj){
if(buttonobj=='yes'){
var myCon = new Ext.data.Connection();
Ext.MessageBox.wait('正在评级数据中, 请稍候……'); //出现一个等待条
myCon.request({
url:quaUrl+"/ratingkw",
method:"POST",
params:{'id':id,'type':'ratingone','grade':?????},
//callback : Function (Optional) options, success : Boolean ,response : Object
callback:function(a,b,c){
Ext.MessageBox.hide();
if(b==true){
Ext.Msg.alert("提示信息",c.responseText,function(){store.reload();},this);
}else{
Ext.MessageBox.alert("系统提示信息","异步通讯失败,更新失败,请与管理员联系!");
}
}
},this);
}//if..yes
},this);
} else {
Ext.Msg.alert("提示","请先选择要评级的行!");
}
},