主要使用的技术:
1、extjs2.0,整体框架
2、RemoteCheckboxGroup.js ,用于动态生成表字段(供查询结果使用)
3、Ext.ux.grid.RowActions.js,用于grid行扩展(上移下移删除等)
4、Datetime.js,用于时间选择
5、MetaGrid.js 用于动态生成查询结果列表(返回结果Grid)
6、ehcache 用于缓存自定表数据,比如表名称、字段描述、长度等固定信息
7、jxl.jar 用于查询结果输出,最后生成Excel文件
8、Java
EditGridPanel主要代码如下: 复制代码 代码如下: 复制代码 代码如下:
{header:'括号',dataIndex:'leftbrackets',width:40,editor:new Ext.grid.GridEditor(new Ext.form.ComboBox({
store: new Ext.data.SimpleStore({
fields:['value','text'],
data: leftBracketsComboData
}),
mode: 'local',
triggerAction: 'all',
editable:false,
valueField: 'value',
displayField: 'text',
readOnly:true
// lazyInit:false,
// listeners: {
// 'focus' :
// function(){
// this.expand();
// }
// }
})),
renderer: function(value, cellmeta, record){
if(value == null || value == ""){
return "";
}
return leftBracketsComboData[value][1];
},scope:this}
,{header:'表名称',dataIndex:'tablename',width:80,editor:new Ext.grid.GridEditor(new Ext.form.ComboBox({
store: new Ext.data.SimpleStore({
fields:['value','text'],
data: baseTableData
}),
id:'baseTableNameID',
tpl: '<tpl for="."><div ext:qtip="{text}">{text}</div></tpl>',
mode: 'local',
triggerAction: 'all',
editable:false,
valueField: 'value',
displayField: 'text',
lazyInit:false,
listeners: {
'expand':function(combo){
combo.clearValue();
combo.store.loadData(baseTableData);
}
,'select':function(){
}
,'focus' :function(){
this.expand();
}
}
})),
renderer: function(value, cellmeta, record, row, col, store){
if(value == null || value == ""){
return;
}
return record.get("tablenamestring");
}}
,{header:'查询条件列',dataIndex:'fieldname',width:90,editor:new Ext.grid.GridEditor(new Ext.form.ComboBox({
id:'fieldnameID'
,store : new Ext.data.Store({
proxy : new Ext.data.HttpProxy({url : '../SearchTableColumns/extlistKV.do'})
,reader : new Ext.data.JsonReader({}, ['name','chinese'])
,baseParams:{s_tablename:'0'}
})
,tpl: '<tpl for="."><div ext:qtip="{chinese}">{chinese}</div></tpl>'
,valueField :'name'
,displayField :'chinese'
,mode : 'remote'
,forceSelection : true
,triggerAction : 'all'
,typeAhead : false
,selectOnFocus : true
,resizable:true
,width : 120
,lazyInit:false
,listeners: {
'focus' :
function(){
this.expand();
}
}
}
)),
renderer: function(value, cellmeta, record, row, col, store){
if(value == null || value == ""){
return "";
}
return record.get("fieldnamestring");
}}
,{header:'逻辑运算符',dataIndex:'relationsign',width:70,editor:new Ext.grid.GridEditor(new Ext.form.ComboBox({
store: new Ext.data.SimpleStore({
fields:['value','text'],
data: relationSignComboData
}),
mode: 'local',
triggerAction: 'all',
editable:false,
valueField: 'value',
displayField: 'text',
readOnly:true,
lazyInit:false,
listeners: {
'focus' :
function(){
this.expand();
}
}
})),
renderer: function(value, cellmeta, record, row, col, store){
if(value == null || value == ""){
return;
}
return relationSignComboData[value][1];
},scope:this}
,{header:'查询条件值',dataIndex:'expressvalue',width:125,editor:new Ext.grid.GridEditor(new Ext.form.TextField({ }))
, renderer: function(value, cellmeta, record, row, col, store){
if(value == null || value == ""){
return "";
}
return record.get("expressvaluestring");
}
}
,{header:'括号',dataIndex:'rightbrackets',width:40,editor:new Ext.grid.GridEditor(new Ext.form.ComboBox({
store: new Ext.data.SimpleStore({
fields:['value','text'],
data: rightBracketsComboData
}),
mode: 'local',
triggerAction: 'all',
editable:false,
valueField: 'value',
displayField: 'text',
readOnly:true,
lazyInit:false,
listeners: {
'focus' :
function(){
this.expand();
}
}
})),
renderer: function(value, cellmeta, record){
if(value == null || value == ""){
return "";
}
return rightBracketsComboData[value][1];
},scope:this}
,{header:'关系运算符',dataIndex:'operatorsign',width:70,editor:new Ext.grid.GridEditor(new Ext.form.ComboBox({
store: new Ext.data.SimpleStore({
fields:['value','text'],
data: operatorSignComboData
}),
mode: 'local',
triggerAction: 'all',
editable:false,
valueField: 'value',
displayField: 'text',
readOnly:true,
lazyInit:false,
listeners: {
'focus' :
function(){
this.expand();
}
}
})),
renderer: function(value, cellmeta, record){
if(value == null || value == ""){
return ;
}
return operatorSignComboData[value][1];
},scope:this}
,this.rowActions
]);