日期:2014-05-16 浏览次数:20500 次
Ext.define('App.view.RoleComboBox',{ extend:'Ext.form.ComboBox', alias:['widget.roleComboBox'], fieldLabel:'Role', valueField:'id', displayField:'name', name:'role', hiddenName:'role', triggerAction:'all', labelAlign:'right', typeAhead:true, minChars:1, editable:false, store:'RoleStore', pageSize:10, selectOnFocus:true, matchFieldWidth:false, listConfig:{ width:240 } });
if(data.roleId){ this.roleComboBox.setValue(data.roleId); this.roleComboBox.setRawValue(data.roleName); }
var roleBox = me.getUserUpdateView().roleComboBox; var roleValue = roleBox.value; var formPanel = btn.up('form'); var form = formPanel.getForm(); var values = form.getValues();//取到表单数据 Ext.apply(values,{role:roleValue});
Ext.Ajax.request({ url:formatUrl('user/userUpdate.do'), method:'POST', params :values, success:function(response){ var responseText = response.responseText; var obj = Ext.JSON.decode(responseText); if(obj.success == 'ok'){ form.reset(); btn.up('window').hide(); Ext.Msg.alert('系统提示','用户修改成功'); me.search(); }else{ Ext.Msg.alert('系统提示','修改失败,'+obj.msg); } }, failure:function(response){ var responseText = response.responseText; var obj = Ext.JSON.decode(responseText); Ext.Msg.alert('系统提示','修改失败'+obj.msg); } });