我用两个grid左右互相拖拽,现在的问题是从第一个grid拖拽到第二个grid中  如何把第二个grid中的数据提交到后台保存?function updateData(modified)
{
    var json = [];
    Ext.each(modified,function(item){
        json.push(item.data);
    });
    if(json.length > 0 )
    {
        Ext.Ajax.request({
            
            url:"URL/Fhwxx/SaveStore.aspx",
            params:{data:Ext.util.JSON.encode(json)},
            
            method:'post',
            success:function(response){
                Ext.Msg.alert("信息","数据保存成功",function(){});
            },
            failure:function(response){
                Ext.Msg.alert("警告","数据保存失败");
            }
        });
    }
    
    else
    {
        Ext.Msg.alert("警告","没有任何保存的数据");
    }
}这是从网上下载的一个保存例子 ,但是我拖拽到第二个Grid后不用modified操作,就想能保存 
另外这句params:{data:Ext.util.JSON.encode(json)}是用来json加密传值 但是到了 后台还需要解析怎么办?
我在后台用string json = Request.Params["data"].toString(); 接收了参数  但是不知道如何插入到数据库
我也下载了个JSONhelper.cs  不知道如何用??
望高手解释一下  或者给个前后的实例 (要具体的可调式的)

解决方案 »

  1.   

    Dictionary<string,object> o = DataRowFromJSON(json);就成了一个键值对了
      

  2.   

    你的两个表数据从哪里来,请说清楚一下我的方法是遍历store, 全部保存,至于json字串,可以去找个JSON解析类
      

  3.   

    我用的是var hwbh = new Array();
                    for(var i=0;i<secondGridStore.getCount();i++){
                        hwbh.push(secondGridStore.getAt(i).get("hwbh"));
                        if(secondGridStore.getAt(i).get("hwbh")!='')
                        {   
                            var json = [];
                            json = secondGridStore.getAt(i).get("hwbh");
                            Ext.Ajax.request({
                                url:"URL/Fhxx/SaveStore.aspx",
                                params:{data:Ext.util.JSON.encode(json)},
                                method:"post",
                                success:function(response){},
                                failure:function(response){}
                            });
                        }
                        else
                        {Ext.Msg.alert("没有数据保存");}
                    }在服务端用string json = Request.Params["data"].toString();接收
    看了一下值 好像有个"\"100201010150001\""