我正在尝试使用Dojo
JSONREST的增强网格,我遇到了一些问题.
我一直在寻找一些例子,但无法弄清楚如何做我需要的.
我一直在寻找一些例子,但无法弄清楚如何做我需要的.
在下面的代码中,我的休息服务有两个参数,并且服务上的查询有效.
问题是,当调用grid.startup()时,它似乎再次调用Rest服务,因为没有传递参数,其余服务都会丢失.我在这做错了什么?
还有什么方法可以更新到商店,以便只包含查询结果?,这样当网格出现时它只包含这些值?
感谢任何帮助或指针..
ready(function(){ var grid; var store = new JsonRest({ target: "rest/search" }); store.query({term: "test",category: "category"},{ start: 10,count: 10,}).then(function(data){ // how do i update store with queried results? }); dataStore = new ObjectStore({ objectStore: store }); /*set up layout*/ var layout = [[ {'name': 'Name','field': 'col1',noresize: true,'width': '100%'},]]; /*create a new grid:*/ grid = new EnhancedGrid({ id: 'grid',store: dataStore,structure: layout,selectable: true,selector: false,selectionMode: 'none',escapeHTMLInData: false,autoHeight:true },document.createElement('div')); grid.startup(); }
解决方法
您是否尝试过设置网格的查询参数?
A link to the docs.
And a link to an example.
通过查看问题中的代码,网格似乎应该显示数据块/页面 – an example using the pagination plugin for the grid.
您可能也对The filter plugin感兴趣.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。