ExtJS Store-复制特定字段以进行存储

| 我正在用rails 3.x实现extjs 3.2.1。我有一个JsonWriter,它通过Json存储库写入MySQL数据库中的所有字段。有没有一种方法可以将记录从一个Json Store复制到另一个Json Store,而字段之间会有一些差异。 这是我尝试的:
var RecRecordDef = Ext.data.Record.create([
                              {name: \'product_master_id\'},
                                {name: \'qty\'},
                               {name: \'stock_price\'},{name: \'discount_rate\'},
                               {name: \'amount\'}
        ]);

    salesbtn.on(\"click\",function(){

                for(var cnt=1;cnt<=salestore.getCount();cnt++)
                {
                    var rectmp= salestore.getAt(cnt);

                    var receiptrec= new RecRecordDef({
                      product_master_id:rectmp.get(\'product_master_id\'),

                       qty:rectmp.get(\'qty\'),
                       stock_price:rectmp.get(\'stock_price\'),
                       discount_rate:rectmp.get(\'discount_rate\'),
                       amount:rectmp.get(\'amount\')
                    });
                    recstore.add(receiptrec);

                }
                  recstore.save();

            });
var recstore= Ext.StoreMgr.get(\'ReceiptStore\');
但我在浏览器的控制台上得到以下输出: 未捕获的TypeError:无法调用未定义的方法\'get \' 有什么建议么? 提前致谢!     
已邀请:
        您必须尝试这样的事情:
Ext.each(salesstore.getRange(), function(item, index, all){
    var receiptrec= new RecRecordDef({
                  product_master_id: item.get(\'product_master_id\'),

                   qty:item.get(\'qty\'),
                   stock_price:item.get(\'stock_price\'),
                   discount_rate:item.get(\'discount_rate\'),
                   amount:item.get(\'amount\')
                });
                recstore.add(receiptrec);
}, this);
recstore.save();
    

要回复问题请先登录注册