带有JSONREST问题的Dojo增强型网格

前端之家收集整理的这篇文章主要介绍了带有JSONREST问题的Dojo增强型网格前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用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感兴趣.

原文链接:https://www.f2er.com/dojo/730053.html

猜你在找的Dojo相关文章