Open AllNamesRTaken opened 12 years ago
Same for Editor.js. Instead of having a synchronous function that creates the editor using the new keyword and expecting that to set up the domNode and get all dependencies synchronously, we could be allowed to supply an async function that returns an instance of the widget (or widget-like class) in its promise. The the rest of the wiring could proceed as normal.
This would allow things such as IoC instanciation of controls with dependency injection.
//J
In my application, a very small percentage of cells are very expensive to compute, rendering them asynchronously will significantly decrease the load time of the rest of the grid.
However, I am not convinced that this needs to be built in to the dgrid. My original plan was to have renderCell insert a loading indicator and generate a closure that will be used to asynchronously update the cell.
:+1: Any news on this? It'd be great to be able to use deferred objects in formatter or renderCell
Yeah that would be great. I am updating from Dojo 1.6 to 1.9 and want to use dgrid now. We are working a lot with deferred Objects and now I can't use my old formatter-functions in the new dgrid. :-(
It would help immensely if the grid would accept renderCell functions that return deferreds. Then we could maybe have async rendering of components in the grid.
this code in Grid.js
}else if(column.renderCell){ // A column can provide a renderCell method to do its own DOM manipulation, // event handling, etc. appendIfNode(td, column.renderCell(object, data, td, options));
could maybe be something like:
}else if(column.renderCell){ cell = column.renderCell(object, data, td, options); if(cell.then) cell.then(function(node) { appendIfNode(td, node); }); else // A column can provide a renderCell method to do its own DOM manipulation, // event handling, etc. appendIfNode(td, cell);
And of course the same in the other places where renderCell or renderHeadercell is used.
//J