I am trying to create a button widget for dojox.grid.
My problems:
1) The button is displayed only when you double-click on the grid.
2) I cannot figure out how to set attributes using declarative markup. It seems that the markupFactory function is responsible for this, but it does not set the widget shortcut. The following code demonstrates what I have:
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileWriteStore");
dojo.require("dijit.form.Button");
dojo.require("dojox.grid.cells.dijit");
dojo.require("dojo.parser");
dojo.declare("dojox.grid.cells.Button", dojox.grid.cells._Widget, {
widgetClass: dijit.form.Button,
alwaysEditing: true,
constructor: function(inCell)
{
this.inherited(arguments);
this.widget = new dijit.form.Button;
},
setValue: function(inRowIndex, inValue){
if (this.widget) {
this.widget.attr('value', inValue);
}
else {
this.inherited(arguments);
}
}
});
dojox.grid.cells.Button.markupFactory = function(node, cell)
{
dojox.grid.cells._Widget.markupFactory(node, cell);
}
source
share