问题描述
||
我尝试将dojox.data.JsonRestStore与我的RESTful服务一起使用。我阅读了sitepen和dojox文档中的文章,但是我不明白它们的全部含义。
我的服务获取诸如
http://<host>/rest/relatedsuggestion?query=weath&results=3
之类的请求并返回JSON
{
Suggestions: [
“weather channel”,“weather forecast”,“weather bbc”
]
}
这意味着它无法理解每个教程中都使用的诸如“ 2”之类的请求。如何使其理解我的格式?据我了解,该课程的回应也很不寻常。
为了尝试JsonRestStore,我编写了以下模拟页面,当然,它不起作用并返回4个错误“类型错误:_57为空”。
<head>
<script src=\"http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js\"
djConfig=\"parseOnLoad: true\">
</script>
<script type=\"text/javascript\">
dojo.require(\"dojox.data.JsonRestStore\");
dojo.require(\"dojox.grid.DataGrid\");
dojo.addOnLoad(function() {
var poStore = new dojox.data.JsonRestStore({target:\"http://<host>/rest/features/relatedsuggestion\"});
poStore.fetchItemByIdentity({
identity:\"3433\",onItem:function(poItem){
poItem.completeOrder();
}
});
});
</script>
<link rel=\"stylesheet\" type=\"text/css\" href=\"http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css\"
/>
</head>
<body class=\" claro \">
<div id=\"gridElement\"></div>
</body>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)