Opened 5 years ago

Closed 4 years ago

#18382 closed defect (patchwelcome)

JsonRest and EnhancedGrid, sorting leads to "undefined" URL part in some cases

Reported by: Lattenfrosch Owned by: Evan
Priority: undecided Milestone: tbd
Component: DojoX Grid Version: 1.10.2
Keywords: Cc:
Blocked By: Blocking:

Description

Hi, I use JsonRest? and EnhancedGrid?. On sorting by clicking the columns the created URL contains an "undefined" part.

When I set the store on initialization of the grid, all is fine:

databasesRestStore = new dojo.store.JsonRest({
   target : "/databases/"
});
databasesDataStore = new dojo.data.ObjectStore({
   objectStore: databasesRestStore
});
				
var databasesGrid = new dojox.grid.EnhancedGrid({
   store : databasesDataStore,
   plugins : { ... }
});
databasesGrid.startup();

leads to the correct URL "http://localhost/databases/?sort(+name)"

But if set later, on events e.g., it fails.

var databasesGrid = new dojox.grid.EnhancedGrid({
   // don't set target property here!
   plugins : { ... }
});
databasesGrid.startup();
databaseGrid.setStore(databasesDataStore);

This leads to the URL "http://localhost/databases/undefined?sort(+name)"

BTW: I found #12572 as similar to my case, but mine adds a special case (#setStore() is called, on initialization it works). And the other bug is four years old - don't know if anybody watches these old bugs, so I open this one. Feel free to reject, I would add my case to the old one...

Change History (1)

comment:1 Changed 4 years ago by bill

Resolution: patchwelcome
Status: newclosed

DojoX Grid and EnhancedGrid are deprecated in favor of dgrid and gridx.

You should upgrade your code to use one of those two grids.

It's possible the community may consider patches to the old DojoX Grid code though.

Note: See TracTickets for help on using tickets.