oria / gridx

Just another powerful Dojo grid
Other
162 stars 78 forks source link

Allow formatter() to return promises #138

Open jsonn opened 10 years ago

jsonn commented 10 years ago

When dealing with foreign key like references, it would be nice to have access to the grid instances itself from formatter() as argument and to be able to return promises like a store.get().

yurychika commented 10 years ago

What do you mean by dealing with foreign key like references? Is there some specific scenario you can share?

jsonn commented 10 years ago

Consider a soccer league manager. The store for the player has a field "team", which contains the id in the corresponding team store.

For a grid showing all players I would like to now use:

formatter(data, grid) { return grid.teamStore.get(data); }

The first change request is the grid argument to make it possible to access additional arguments. Alternatively a reference to the cell widget to get it from their would work as well. This avoids the needs for complicated grid constructors.

The second change request deals with allowing promises as it currently plainly doesn't work.