问题描述
下午好。我试图通过ItemFileReadStore从服务器获取数据,并将数据从请求传递到创建的输入。这是我编写的代码
require([
"dojo/store/JsonRest","dojo/data/ItemFileReadStore","dojo/dom","dojo/data/ObjectStore","dojo/domReady!"
],function (JsonRest,ItemFileReadStore,dom) {
restStore = new JsonRest({
target: "http://localhost:8080/myservice/getSearchResult",handleAs: "json",headers: {"Range": "0-4"}
});
dataStore = new ItemFileReadStore({objectStore: restStore});
dataStore.fetch({
query: {},onItem: function (item) {
inputCreate(dataStore.getValue(item,'blogDate'));
inputCreate(dataStore.getValue(item,'blogText'));
}
});
});
require(["dojo/dom-construct"],inputCreate = function (domConstruct,text){
domConstruct.create("div",{ innerHTML: "<input>text</input>" });
});
但是,当我启动该应用程序并在浏览器中打开该应用程序时,什么也没有发生。控制台中不会显示任何错误。告诉我我做错了什么?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)