尝试加载使用商店传递的数据 [英] Trying to load data that is being passed by using a store
本文介绍了尝试加载使用商店传递的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试获取正在传递的数据并将其加载到各种文本框中。现在,我有一个包含这个的.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屋!
查看全文