Trying to load data that is being passed by using

2019-02-21 00:02发布

I am trying to get data that is being passed and load it into various textfields. Right now, I have a .html file which contains this:

<script type="text/javascript">
var res = {"address":"","city":"","state":"","zip":""};
</script>

Then, I have a .js file which contains my entire layout with all the textfields, etc. and my entire store. This is what I have so far as my store trying to load the data, but I am not sure what the correct method is to try and get the data from the html file and display it on my js file.

var newStore= new Ext.data.ArrayStore({
        fields: ['address', 'city', 'state', 'zip'],
        loadData: (res),
        idIndex: 0 
    });

Could someone please help me as I am a bit lost on what to do?

1条回答
Melony?
2楼-- · 2019-02-21 00:36

Try ArrayStore Like this.

var newStore= new Ext.data.ArrayStore({
    fields: ['address', 'city', 'state', 'zip']
     });
newStore.add(res);
newStore.commitChanges()

This should work.

查看更多
登录 后发表回答