how to get array of objects from store in extjs 4.2 and send it to server side?

放肆的年华 提交于 2019-12-03 21:04:29

Here's a simple example of how to do what you want:

function sendGridData(){

    var sendDataArray = [];
    store.each(function(record){
        var recordArray = [
            record.get("id"),
            record.get("name"),
            record.get("date"),
            record.get("notes"),
            record.get("Type")
        ];
        sendDataArray.push(recordArray);
    });

    Ext.Ajax.request({
        url: "your_url_here.jsp",
        success: function(response, opts){
            //?
        },
        failure: function(response, opts) {
            alert("server-side failure with status code " + response.status);
        },
        params: {
            grid_data: Ext.encode(sendDataArray);
        }
    });
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!