PropertyGrid代码示例(Ext1.x)
来源:百度文库 编辑:神马文学网 时间:2024/04/29 07:03:33
Extjs Documentation Center中竟然没有Ext.grid.PropertyGrid的APIDOC和Examples(估计要收费才有完整的文档, 有点恶心).例子代码如下: Ext.namespace('Ext.propsgriddata');
//客户类型
Ext.propsgriddata.custtype = [
['1', '个人'],
['0', '机构']
];var Ed = Ext.grid.GridEditor;
var propsGrid = new Ext.grid.PropertyGrid('props-grid', ...{
nameText: 'new query',
enableHdMenu: false,
viewConfig : ...{
forceFit:true,
scrollOffset:2 // the grid will never have scrollbars
}
}); propsGrid.setSource(...{
"(名称)": "新查询",
"客户类型": "个人",
"对帐单寄送": true,
"有效地址": false,
"有效手机号": false,
"有效Email": false,
"合并持有金额":0,
"截止持有日期":new Date()
}); //实现单元格的自定义editor
propsGrid.customEditors = ...{
'客户类型' : new Ed(new Ext.form.ComboBox(...{
typeAhead: true,
triggerAction: 'all',
store: new Ext.data.SimpleStore(...{
fields: ['cust_type', 'cust_type_name'],
data : Ext.propsgriddata.custtype
}),
displayField:'cust_type_name',
forceSelection:true,
name:'cust_type',
valueField:'cust_type',
mode:'local'
}))
}; //改变grid中日期值的格式为'yyyy/mm/dd'
propsGrid.getColumnModel().dateFormat = 'Y/m/d'; //改变DateField中日期值的格式为'yyyy/mm/dd'
var f = Ext.form;
propsGrid.getColumnModel().editors['date']= new Ext.grid.GridEditor(new f.DateField(...{format:'Y/m/d',selectOnFocus:true}));
propsGrid.render();
对于customerEditor,还需要定义propsGrid.colModel.renderCellDelegate,以便在PropertyGrid的value列显示文本(个人/机构),另外,对于默认值是date类型的属性,例如上面的“截止持有日期”,PropertyGrid会自动配置一个DateField作为Editor,但是这个DateField Editor有一个问题,如果删除value值后,点按其它位置,然后再次点按“截止持有日期”的value单元,DateField Editor不会出现,变成了普通的文本框了。解决的方法是,将默认值设为空'',然后手工为属性设置一个DateField Editor 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/xujiaqiang/archive/2007/07/09/1683768.aspx
//客户类型
Ext.propsgriddata.custtype = [
['1', '个人'],
['0', '机构']
];var Ed = Ext.grid.GridEditor;
var propsGrid = new Ext.grid.PropertyGrid('props-grid', ...{
nameText: 'new query',
enableHdMenu: false,
viewConfig : ...{
forceFit:true,
scrollOffset:2 // the grid will never have scrollbars
}
}); propsGrid.setSource(...{
"(名称)": "新查询",
"客户类型": "个人",
"对帐单寄送": true,
"有效地址": false,
"有效手机号": false,
"有效Email": false,
"合并持有金额":0,
"截止持有日期":new Date()
}); //实现单元格的自定义editor
propsGrid.customEditors = ...{
'客户类型' : new Ed(new Ext.form.ComboBox(...{
typeAhead: true,
triggerAction: 'all',
store: new Ext.data.SimpleStore(...{
fields: ['cust_type', 'cust_type_name'],
data : Ext.propsgriddata.custtype
}),
displayField:'cust_type_name',
forceSelection:true,
name:'cust_type',
valueField:'cust_type',
mode:'local'
}))
}; //改变grid中日期值的格式为'yyyy/mm/dd'
propsGrid.getColumnModel().dateFormat = 'Y/m/d'; //改变DateField中日期值的格式为'yyyy/mm/dd'
var f = Ext.form;
propsGrid.getColumnModel().editors['date']= new Ext.grid.GridEditor(new f.DateField(...{format:'Y/m/d',selectOnFocus:true}));
propsGrid.render();
对于customerEditor,还需要定义propsGrid.colModel.renderCellDelegate,以便在PropertyGrid的value列显示文本(个人/机构),另外,对于默认值是date类型的属性,例如上面的“截止持有日期”,PropertyGrid会自动配置一个DateField作为Editor,但是这个DateField Editor有一个问题,如果删除value值后,点按其它位置,然后再次点按“截止持有日期”的value单元,DateField Editor不会出现,变成了普通的文本框了。解决的方法是,将默认值设为空'',然后手工为属性设置一个DateField Editor 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/xujiaqiang/archive/2007/07/09/1683768.aspx
PropertyGrid代码示例(Ext1.x)
html代码示例 网页教程与代码
Oracle官方示例---Java 存储过程示例代码区
从数据库中读出图片并显示的示例代码
服务器文件信息偷窥下载程序 示例代码
[原创]经典问题vba代码示例[ExcelHome技术论坛]
VB treeview使用示例代码(从数据库中读入
服务器文件信息偷窥下载程序 示例代码
Excel 数据导入到 Access、Sql Server 中示例代码
善用 .NET 的 PropertyGrid 控件
VB示例:VB中使窗体右上角的X按钮失效
Symbian编程三部曲--代码和文档的获取x
运行时自定义PropertyGrid显示属性项目
JNI示例
索引示例
NTSVC示例
struts2 示例
起名示例
struts2 示例
代码:
log4j使用示例
绝句律诗格律示例
作文升格示例
spring aop alliance示例