How to retrieve JSON Data Array from ExtJS Store

后端 未结 15 2170
忘掉有多难
忘掉有多难 2020-12-04 17:04

Is there a method allowing me to return my stored data in an ExtJS Grid Panel exactly the way I loaded it using:

var data = [\"value1\", \"value2\"]
Store.lo         


        
15条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-04 17:12

     function getJsonOfStore(store){
            var datar = new Array();
            var jsonDataEncode = "";
            var records = store.getRange();
            for (var i = 0; i < records.length; i++) {
                datar.push(records[i].data);
            }
            jsonDataEncode = Ext.util.JSON.encode(datar);
    
            return jsonDataEncode;
        }
    

提交回复
热议问题