首页 > 代码库 > extjs三种传值方式

extjs三种传值方式

extjs三种传值方式:

1,params传值
Ext.Ajax.request({
   url : ‘referfriend/getReferfriends‘,
   method : ‘GET‘,
   params : {
    customerId: rec.data[‘id‘]
   },
   success : function(response, opts) {
    var data = http://www.mamicode.com/Ext.JSON.decode(response.responseText);
    this.getIntroducerList().store.loadData(this.convertModel(data.introducers));
    this.getIntroducedList().store.loadData(this.convertModel(data.introduceds));
   },
   failure : function(response, opts) {
    Ext.MessageBox.show({
     title : ‘获取亲传关系失败‘,
     msg : response.error.message,
     icon : Ext.Msg.ERROR,
     buttons : Ext.Msg.OK
    });
   },
   scope : this
  });

controller用此种方式接值
@RequestMapping(value = "http://www.mamicode.com/getReferfriends", method = RequestMethod.GET)
 @ResponseBody
 public ReferfriendVo getReferfriends(
   @RequestParam(value = "http://www.mamicode.com/customerId") java.lang.Long customerId,
   @ActiveUser User activeUser) {}

2,

if (record.length == 1) {
//      Ext.Ajax.request({
//       url : ‘referfriend/adjustReferfriend‘,
//       method : ‘DELETE‘,
//       jsonData : newReferfriend,//后台用@RequestBody Referfriend updateReferfriend,
//       success : function(response, opts) {
//        me.executeloadData(me.customer);
//        Ext.MessageBox.show({
//         title : ‘提示‘,
//         msg : ‘调整成功!‘,
//         icon : Ext.Msg.INFO,
//         buttons : Ext.Msg.OK
//        });
//        window.hide();
//       },
//       failure : function(response, opts) {
//        Ext.MessageBox.show({
//            title: ‘获取介绍人奖励配置‘,
//            msg: response.error.message,
//            icon: Ext.Msg.ERROR,
//            buttons: Ext.Msg.OK
//           });
//       },
//       scope : this
//      });


3, url : ‘referfriend/‘ + record[0].get(‘id‘)+ ‘/referfriendReview‘,后台用@PathVariable("id") Referfriend referfriend

extjs三种传值方式