dojox.data.Grid中的小部件(dijit.form.Button)
我可以将dijit.form.DateTextBox和dijit.form.ComboBox放在dojox.grid.DataGrid中,但不能放在dijit.form.Button中。我没有尝试过其他小部件dojox.data.Grid中的小部件(dijit.form.Button),grid,widget,dojo,Grid,Widget,Dojo,我可以将dijit.form.DateTextBox和dijit.form.ComboBox放在dojox.grid.DataGrid中,但不能放在dijit.form.Button中。我没有尝试过其他小部件 new dojox.grid.DataGrid({ store: new dojo.data.ItemFileReadStore({data: {items: [{option: 'option A', date:'10/31/2011'},{option: optio
new dojox.grid.DataGrid({
store: new dojo.data.ItemFileReadStore({data: {items: [{option: 'option A', date:'10/31/2011'},{option: option B'}]}}),
structure:[{
field: "option",
editable: true,
type: dojox.grid.cells._Widget,
widgetClass: dijit.form.ComboBox,
widgetProps: {
store: new dojo.data.ItemFileReadStore({data: {items: [{option: 'option A'},{position: option B'}]}}),
searchAttr: 'option'
},{
field: 'date',
editable: true,
type: dojox.grid.cells.DateTextBox,
widgetProps: {selector: "date"},
formatter: function(v) {if (v) return dojo.date.locale.format(new Date(v),{selector: 'date'})}
},{
field: "button",
type: dojox.grid.cells._Widget,
editable: true,
widgetClass: dijit.form.Button,
widgetProps: {style: {width: "100px"},label: "dijit button?"}
}]
})
Salu2
Jose Leviaguirre从1.4开始,网格似乎可以通过格式化程序处理DIJIT
{
field: "button",
type: dojox.grid.cells._Widget,
editable: false,
formatter: function(){
return new dijit.form.Button({label:"test"})
}
这是一个有效的示例解决方案:您应该在答案栏中张贴您的答案,然后接受它,这样问题就列为已回答