码迷,mamicode.com
首页 > Web开发 > 详细

extjs三种传值方式

时间:2014-10-09 13:42:23      阅读:331      评论:0      收藏:0      [点我收藏+]

标签:io   ar   java   sp   on   cti   ad   ef   new   

extjs三种传值方式:

1,params传值
Ext.Ajax.request({
   url : ‘referfriend/getReferfriends‘,
   method : ‘GET‘,
   params : {
    customerId: rec.data[‘id‘]
   },
   success : function(response, opts) {
    var data = 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 = "/getReferfriends", method = RequestMethod.GET)
 @ResponseBody
 public ReferfriendVo getReferfriends(
   @RequestParam(value = "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三种传值方式

标签:io   ar   java   sp   on   cti   ad   ef   new   

原文地址:http://www.cnblogs.com/junluoyu/p/4012716.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!