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 に答える