尝试加载正在使用存储传递的数据 [英] Trying to load data that is being passed by using a store

查看:23
本文介绍了尝试加载正在使用存储传递的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取正在传递的数据并将其加载到各种文本字段中.现在,我有一个 .html 文件,其中包含:

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>

然后,我有一个 .js 文件,其中包含我的整个布局、所有文本字段等以及我的整个商店.就我的商店尝试加载数据而言,这就是我所拥有的,但我不确定尝试从 html 文件中获取数据并将其显示在我的 js 文件上的正确方法是什么.

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?

推荐答案

像这样试试 ArrayStore.

Try ArrayStore Like this.

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

这应该可行.

这篇关于尝试加载正在使用存储传递的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆