Opened 8 years ago

Closed 8 years ago

#12702 closed defect (duplicate)

duplicates are shown after add items to DataGrid when used with ClientFilter and JsonRestStore

Reported by: ant Owned by: Jared Jurkiewicz
Priority: high Milestone: tbd
Component: DojoX Data Version: 1.4.3
Keywords: Cc:
Blocked By: Blocking:

Description

I have having some problems with adding items to DataGrid? when used with ClientFilter? and JsonRestStore?. It sounds similar to another ticket (#7743).

I am using Dojo 1.4.3 (21629). The problem is happening in all browsers I use(IE 8.06001.18702, Firefox 3.6.16, Chrome 10.0.648.204). OS is Windows XP SP 3.

dojo.require("dojox.grid.DataGrid?"); dojo.require("dojox.data.ClientFilter?"); dojo.require("dojox.data.JsonRestStore?");

resourceStore = new dojox.data.JsonRestStore?({

target: targetURL, labelAttribute: "id", idAttribute: "id"

});

resourceGrid = new dojox.grid.DataGrid?({

store: resourceStore, structure: resourceGridLayout, selectionMode: "single", queryOptions:{cache:true, ignoreCase: true}, clientSort: true, rowsPerPage: 5, sortFields:[{attribute:'name'},{attribute:'version'}], updateDelay: 0, onSelectionChanged : function(){

var selected = resourceGrid.selection.getSelected(); dojo.publish("resource_selection_changed", [selected[0]]);

}

});

Problem: If I add a item to the grid above,duplicate items will show in the datagrid on every 5th row. In this example, I have added a new resource named “00” and in the datagrid, the items 5th row and the 10th row … are replaced by a duplicate of the newly added item. Please see the attachment picture named “after_add). Actually, if I change the resourceGrid.rowsPerPage property to a different number, let say X, a duplicate will show on every Xth row in the grid. Note that there is only one item add request sent to the server and inserted to the database. Clicking on columns to resort does not help. However, if I refresh the page, the datagrid will display properly again.

The add button leads to the following code

item = resourceStore.newItem(json_data);

resourceStore.save({

onError: function(e){

resourceDialog.hide();

}, onComplete: function(){

resourceDialog.hide(); resourceGrid.filter({},true); resourceGrid.sort();

}

Change History (1)

comment:1 Changed 8 years ago by Kenneth G. Franqueiro

Resolution: duplicate
Status: newclosed

Looks like exact duplicate of #12703 (double post?)

Note: See TracTickets for help on using tickets.