Note that there are some explanatory texts on larger screens.

plurals
  1. PODuplicated rows when sorting dgrid 0.3.6
    primarykey
    data
    text
    <p>I've been using dgrid 0.3.2 along with JsonRest to display tables of data. Recently, I've been looking at upgrading to dgrid 0.3.6 or 0.3.7. Things work mostly the same, but it seems with the newer versions of dgrid that, if the user clicks a column header to sort fast enough, the grid will start displaying duplicate rows. I’ve verified that the response JSON and range are correct, and this didn’t seem to happen when we used dgrid 0.3.2.</p> <p>Here’s a simple test case that reproduces the problem, and mimics how we set up our grid and store. Am I doing something wrong? If I don’t wrap the JsonRest in a Cache, I don’t get this issue, so I’m sure the problem is there, but I’m unsure about the performance ramifications of not caching the JSON response.</p> <pre><code>&lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;% String dgridVer = request.getParameter("dgridVer"); if (dgridVer==null) { dgridVer = "0.3.6"; } %&gt; &lt;script type="text/javascript"&gt; var dojoConfig = { isDebug: true, baseUrl: 'dojo', packages: [ { name: 'dojo', location: 'dojo' }, { name: 'dijit', location: 'dijit' }, { name: 'dojox', location: 'dojox' }, { name: 'dgrid', location: 'dgrid-&lt;%=dgridVer%&gt;' }, { name: 'put-selector', location: 'put-selector' }, { name: 'xstyle', location: 'xstyle' }, { name: 'datagrid', location: '../datagrid' } ] }; &lt;/script&gt; &lt;script src="dojo/dojo/dojo.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; Try sorting a column as fast as you can. Look for duplicated rows.&lt;br&gt; Using dgrid version: &lt;%=dgridVer %&gt;&lt;p&gt; &lt;div id='gridDiv'&gt;&lt;/div&gt; &lt;script&gt; require(['dgrid/Grid', 'dgrid/extensions/Pagination', 'dojo/store/JsonRest', 'dojo/store/Cache', 'dojo/store/Memory', 'dojo/_base/declare', 'dojo/domReady!'], function(Grid, Pagination, JsonRest, Cache, Memory, declare) { var columns = [ { field: "first", label: "First Name" }, { field: "last", label: "Last Name" }, { field: "age", label: "Age" } ]; var store = new JsonRest({ target: 'testData.jsp', sortParam: "sortBy" }); store = Cache(store, Memory()); var grid = new (declare([Grid, Pagination]))({ columns: columns, store: store, loadingMessage: 'Loading...', rowsPerPage: 4, firstLastArrows: true }, 'gridDiv'); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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