Using Diferred with Dojo DataGrid
I am having problems with adding function events on a button situated in a
datagrid.
The data of the grid is loaded by json-rest-store and the buttons column
is loaded with it.
whenever I need to add this:
Spring.addDecoration(new Spring.AjaxEventDecoration({elementId: button.id,
event:'onclick', params: { _eventId: "details", fragments: "content" }}));
it says no id is present, because the loading is not ready yet.
I am using differed like this:
var id;
var deferred = new Deferred(function(reason){
id = dojo.byId('searchbox3');
});
deferred.progress(update);
deferred.resolve(value);
deferred.then(function(value){
Spring.addDecoration(new Spring.AjaxEventDecoration({elementId:
button.id, event:'onclick', params: { _eventId: "details", fragments:
"content" }}));
}, function(err){
}, function(update){
});
deferred.cancel(reason);
doesn't work
what am I doing wrong?
No comments:
Post a Comment