2010-03-19 62 views
0

我們有一種情況,我們需要在具有重複行的網格中顯示來自數據庫的數據,但當單元格數據與Sorry, an error occurred相同時,至少基本示例失敗。示例如下:dojox.grid.DataGrid無法顯示重複行嗎?

  
    <script> 
     dojo.require("dojo.data.ItemFileWriteStore"); 
     dojo.require("dojox.grid.DataGrid"); 

     var historyData = { 
      'identifier': 'time', 
      'label': 'time', 
      'items': [ 

      { 
      'message': 'Please turn in your TPS reports immediately', 
       'time': 'March 3 2010 7:20 AM', 
       'sentBy':'Bill Lumbergh' 

      }, 
      { 
      'message': 'Please turn in your TPS reports immediately', 
       'time': 'March 3 2010 7:20 AM', 
       'sentBy':'Bill Lumbergh' 

      }] 
     }; 

     var historyGridLayout = [ 
      [{ 
      field: "message", 
      name: "Message" 
     }, 
     { 
      field: "time", 
      name: "Display Date & Time" 
     }, 
     { 
      field: "sentBy", 
      name: "Sent By" 
     }]]; 

    </script> 

    <body class="tundra "> 
     <div dojoType="dojo.data.ItemFileWriteStore" data="historyData" jsId="historyStore"> 
     </div> 
     <div id="grid" dojoType="dojox.grid.DataGrid" store="historyStore" structure="historyGridLayout"> 
     </div> 
    </body>

幫助!

回答

1

嗯,你可以從你的數據(historyData)中刪除標識符字段,網格應該可以工作。