Reputation: 12120
who knows a way to create a custom cell fora dojox.grid.DataGrid
? I of course could use the get and formatter properties of the layout, but this is not a really reusable solution!
Thanks for your input!
heinrich
Upvotes: 1
Views: 2986
Reputation: 622
You can try an indirect way to add a dojo widget to a grid cell
1) Set escapeHTMLInData
to false
for the dojox.grid.DataGrid
2) Then in the get/formatter function try something like
function formatterFn() {
var buttonToReturn = dijit.form.Button({
/* Button attributes */
}
var div = document.createElement("div");
div.appendChild(buttonToReturn.domNode);
return div.innerHTML;
// You can leave the div orphan
}
You can conditionally return different widgets to suit your needs
Hope it helps!
Upvotes: 1
Reputation: 4123
What do you mean by custom cell?
Do you want to use check box or textbox instead of text? or
Do you want to show images instead of text?
In the first case
In the second case you can use the formatter function.
It is better to use the existing functions and classes. Extending will make the grid slower.
Upvotes: 2