看了PropertyGrid官方的代码一直想扩展value的类型
var propsGrid = new Ext.grid.PropertyGrid( {
border : false,
width : 300,
autoHeight : true,
viewConfig : {
forceFit : true,
scrollOffset : 2
},
buttons : [ {
text : '确认提交',
handler : function() {
var articlelist = new Array();
var selections = sm.getSelections();
for ( var i = 0; i < selections.length; i++) {
articlelist.push(selections[i].id);
}
Ext.Ajax.request( {
url : 'datatran',
params : {
alist : articlelist.join(","),
tarCata : propsGrid.getSource()["发送到目标栏目"]
},
success : function(result, action) {
Ext.Msg.alert('操作', result.responseText);
},
failure : function(form, action) {
Ext.MessageBox.alert('消息', '数据载入失败');
}
});
}
} ]
});
propsGrid.setSource( {
"是否发布发件" : false,
"发送到目标栏目" : "",
"修改发布时间" : ""
});
var catacmb = new Ext.ux.form.LovCombo( {
mode : 'local',
store : CatalogStore,
displayField : 'name',
valueField : 'id',
hiddenField : 'id',
name : 'tar_cata',
triggerAction : 'all',
selectOnFocus:true
});
propsGrid.customEditors = {
//新增下拉选项
'发送到目标栏目' : new Ext.grid.GridEditor(catacmb),
//时间控件需要增加这个编辑器,否则在单元格的时间清空了的话就不在有时间编辑器了
'修改发布时间' : new Ext.grid.GridEditor(new Ext.form.DateField())
};
posted @ 2010-05-14 00:23 贪吃老鼠 阅读(328) 评论(0)
编辑
在PropertyGrid使用了Ext.ux.form.LovCombo控件,但是一直存在多选记录无法保存,通过firefox调试发现问题出在ComboBox中
assertValue方法在验证选项值的正确性,解决办法在LovCombo中加一个assertValue:Ext.emptyFn.
此前还增加了一个方法
1 beforeBlur:function(){
2 this.setValue(this.getCheckedValue());
3 }
这个是网上说的,只是写了,没有具体是测试问题出在哪里.
posted @ 2010-05-14 00:14 贪吃老鼠 阅读(454) 评论(0)
编辑