Question

I have an enhancedGrid backed by a JsonRestStore which displays summary information and can be clicked to show and edit the full information in another tab. However when I then refresh the grid with a setQuery command any items that have been edited are removed from the grid (though they still seem to be in the _index property of the store).

This happens if I just update the database manually or use a dojo editor. The json coming back from the server is still valid and if I do a page refresh in the browser the item re-appears. Any ideas what might be going on?

This is the code to create the grid.

var gridStore = new dojox.data.JsonRestStore({
    target : '/api/prospects/',
    idAttribute : 'prospect_id',
}); 

var grid = new dojox.grid.EnhancedGrid({
    store: gridStore,
    structure: gridStructure,
    columnReordering: true,
    selectionMode: 'single',
    plugins: {filter: true},
});
gridPane.setContent(grid);

This is the code to set the query

dojo.connect(tree,'onClick', function(node){
    if (node.type == 'project') {
        grid.setQuery({project:node.project_id});
    }
});
Was it helpful?

Solution

Typical after searching high and low for the reason that this is happening I find the answer after posting it here. It seems that jsonreststore has a bug in its rendering engine that could be solved by removing a few lines from the ClientFilter file (presumably, although I haven't checked JsonRestStore has the exact same bug as I tested with and without cacheing and had the same result).

Details are at the bottom of this page

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top