以编程方式创建 DOJOX 增强网格时出错



我得到"对不起,发生错误"。在撕裂我创建的增强型网格时。

JSON 对象是在我尝试渲染的请求属性"数据项"中设置

{"items":[{"prinId":"0280","subClientId":"5187","clientId":"9006","sysId":"3759"}],"label":"userId","identifier":"requestId"}

道场守则如下

<script>dojoConfig = {async: true, parseOnLoad: true}</script>
    <script>
    require([
    "dojo/_base/lang", 
    "dojox/grid/EnhancedGrid",  
    "dojo/data/ItemFileWriteStore", 
    "dojo/dom","dojox/grid/cells", 
    "dojox/grid/enhanced/plugins/Pagination", 
    "dojox/grid/enhanced/plugins/NestedSorting",
    "dojo/on",
    "dojo/_base/event",
    "dojo/parser",
    "dojo/_base/array",
    "dojo/dom",
    "dojox/grid/enhanced/plugins/IndirectSelection",
    "dijit/Dialog",
    "dijit/form/Form",
    "dijit/form/TextBox",
    "dijit/form/DateTextBox",
     "dojo/domReady!"],

      function(lang, EnhancedGrid, ItemFileWriteStore, dom,gridCells,Pagination,NestedSorting,on,event,parser,array,dom,IndirectSelection,Dialog,Form){
   var store=new dojo.data.ItemFileReadStore({data: <%=request.getAttribute("dataItems")%>});

   var layout = [{name: 'Client Bank Id', field: 'clientId', width: '130px'},
                    {name: 'Sub Client Bank Id', field: 'subClientId', width: '130px'},
                    {name: 'Sys Id', field: 'sysId', width: '130px'},
                    {name: 'Prin Id', field: 'prinId', width: '220px'}];
            /*create a new grid*/
      var grid = new dojox.grid.EnhancedGrid({
          id: 'grid',
          store: store,
          structure: layout,

           plugins: {
           nestedSorting: true
          /*  pagination: {
                pageSizes: ["25", "50", "100", "All"],
                description: true,
                sizeSwitch: true,
                pageStepper: true,
                gotoButton: true,
                maxPageStep: 3,                            
                position: "bottom"
            }  */
          }

          },document.createElement('div'));
          /*append the new grid to the div*/
   dojo.byId("gridDiv").appendChild(grid.domNode);
   grid.startup();


   });
    </script>

嗯,这是您的商店定义,特别是标识符的值。这需要是元素名称之一。尝试类似于以下存储对象的内容:

var store = new dojo.data.ItemFileReadStore({
  data: {
    "items":[
      {"prinId":"0280", "subClientId":"5187", "clientId":"9006", "sysId":"3759" }
    ],
    "label":"clientId",
    "identifier":"clientId"
  }
});

相关内容

  • 没有找到相关文章

最新更新