Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You get this error because you are trying to create new grid widget each time button is clicked. There are 2 possible solutions: manually destroy existing widget, or create only one instance of grid widget and reuse it. </p> <p>I think, you don't need to recreate your grid every time data is received from the server. I suggest you to move all your grid initialization logic (including structure, but except store assignment) into new method like <code>initGrid</code>, that will create empty grid. And call it one page load:</p> <pre><code> dojo.ready(function() { initGrid(); }); </code></pre> <p>Then, when data received from the server, you can initialize data store and update grid (adjust your <code>postToPage</code> function):</p> <pre><code> function postToPage(data){ var storedata = { identifier:"ActID", items: data }; var store1 = new dojo.data.ItemFileWriteStore({data: storedata}) ; var grid = dijit.registry.byId("gridDiv"); grid.set("store", store1); grid.filter(); } </code></pre> <p>This should work. Also I suggest you not to use inline CSS styles and <code>center</code> tag.</p> <p><strong>Update:</strong></p> <p>You don't need to connect to <code>onRowClick</code> event each time data is updated, so it should be done in <code>initGrid</code> too.</p> <p>Your <code>initGrid</code> method should look like this:</p> <pre><code> function initGrid() { var gridStructure =[[ // declare your structure here ]]; var grid = new dojox.grid.DataGrid({ structure: gridStructure, rowSelector: '30px', selectionMode: "single", autoHeight:true, columnReordering:true },'gridDiv'); dojo.connect(grid, "onRowClick", grid, function(){ // onRowClick handler }); grid.startup(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload