带有JSONREST问题的Dojo增强型网格
发布时间:2020-12-16 21:20:17  所属栏目:百科  来源:网络整理 
            导读:我正在尝试使用Dojo JSONREST的增强网格,我遇到了一些问题. 我一直在寻找一些例子,但无法弄清楚如何做我需要的. 在下面的代码中,我的休息服务有两个参数,并且服务上的查询有效. 问题是,当调用grid.startup()时,它似乎再次调用Rest服务,因为没有传递参数,其余
                
                
                
            | 
                         
 我正在尝试使用Dojo 
 JSONREST的增强网格,我遇到了一些问题. 
  
我一直在寻找一些例子,但无法弄清楚如何做我需要的. 在下面的代码中,我的休息服务有两个参数,并且服务上的查询有效. 还有什么方法可以更新到商店,以便只包含查询结果?,这样当网格出现时它只包含这些值? 感谢任何帮助或指针.. 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感兴趣. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!  | 
                  
