0

我已经创建了一个编辑器网格面板,其中我已经编辑了数据并将修改后的记录存储在数组中,如何将这些记录传递给 jsp 页面以在数据库中更新

            function modifycheckpoints(){
     var updateddata =new Array(); 
     updateddata.push(checkpoint.getModifiedRecords());
       Ext.Ajax.request({   
          url: 'update_checklist.jsp',
          params: {             
                     updatedcheckpoint: updateddata
                              }, 
          success: function(response){                          
             Ext.Msg.alert("Result","Data modified successfully");
             checkpoint.reload();
          },
          failure: function(response){
              Ext.MessageBox.alert('Error','could not connect to the database. retry later');       
          }                                     
       });   
      }
     });

我试过这样但我没有在jsp页面中获取数据可以请帮助我

4

1 回答 1

1

我们需要在发送之前对修改后的记录进行编码

var updateddata = myGrid.getStore().getModifiedRecords();
        var ch = new Array();

        for (var i = 0; i < updateddata.length; i++) {

            ch.push(updateddata[i].data);

        }
        ch = Ext.encode(ch);

编码后我们将获取数据为 json 字符串

于 2012-10-23T06:09:42.457 回答