52,792
社区成员




materialSearchFiled=Ext.extend(Ext.form.Field,{
constructor:function (){
materialSearchFiled.superclass.constructor.call(this,{
id:'find_Name',
// renderTo : Ext.getBody(),
xtype:'field',
value :'请输入素材名称',
listeners:{
focus:function (s){
this.setValue("");
},
blur:function (){
if (this.getValue().length == 0){
this.setValue("请输入素材名称");
}
}
}
})
}
});
materialSearchBeginSize=Ext.extend(Ext.form.Field,{
constructor:function (){
materialSearchBeginSize.superclass.constructor.call(this,{
id:'find_beginSize',
// renderTo:Ext.getBody(),
xtype:'field',
value:'起始值(单位KB)',
listeners:{
focus:function (){
this.setValue("");
},
blur:function (){
if (this.getValue().length == 0){
this.setValue('起始值(单位KB)')
}
}
}
})
}
});
materialSearchEndSize=Ext.extend(Ext.form.Field,{
constructor:function (){
materialSearchEndSize.superclass.constructor.call(this,{
id:'find_endSize',
// renderTo:Ext.getBody(),
// regex:/^[^\d\.]+?$/,
value:'结束值(单位KB)',
listeners:{
focus:function (){
this.setValue("");
},
blur:function (){
if (this.getValue().length == 0){
this.setValue('结束值(单位KB)')
}
},
change:function (thiz,newValue,oldValue){
// alert("--"+newValue.replace(^/[^\d\.]+?/g,''))
}
}
})
}
});
materialSearchEmpty=Ext.extend(Ext.form.Field,{
constructor:function (){
materialSearchEmpty.superclass.constructor.call(this,{
hidden :true
})
}
});
materialfindToolbar = Ext.extend(Ext.Toolbar,{
choiceSearch:null,
choiceSearch1 : null,
constructor:function (){
choiceSearch = new materialSearchFiled();
choiceSearch1=new materialSearchEmpty();
materialfindToolbar.superclass.constructor.call(this,{
items : [
{
xtype: 'combo',
triggerAction: 'all',
width:100,
displayField: 'name',
emptyText:"素材名称",
id:'materCombo',
store:[
'素材名称',
'大小',
'类型'
],
listeners:{
select:function (combo, record, index){
choiceCombo=index
alert(index + "--" + record.data.text) // 根据选择的index 生成不同的Field
if (index == 0){
choiceSearch = new materialSearchFiled();
}
else if (index == 1){
}
}
}
}
,new Ext.Toolbar.Separator(),
choiceSearch,
choiceSearch1
,{
id:'search_name',
cls:'search',
text:'查询'
},new Ext.Toolbar.Fill(), // 右对齐
{
id : 'materialUplpad',
text : '上传',
aligh : 'right'
}, new Ext.Toolbar.Separator(), {
id : 'materialDel',
text : '删除'
}]
})
}
})
materialGridPanel = Ext.extend(Ext.grid.GridPanel, {
mToolbar : null,
constructor:function (){
mToolbar = new materialfindToolbar();
materialGridPanel.superclass.constructor.call(this,{
renderTo : Ext.getBody(),
// title:'dsf',
tbar : mToolbar
})
}
})
materialSearchFiled=Ext.extend(Ext.form.Field,{
constructor:function (){
materialSearchFiled.superclass.constructor.call(this,{
id:'find_Name',
// renderTo : Ext.getBody(),
xtype:'field',
value :'请输入素材名称',
listeners:{
focus:function (s){
this.setValue("");
},
blur:function (){
if (this.getValue().length == 0){
this.setValue("请输入素材名称");
}
}
}
})
}
});
materialSearchBeginSize=Ext.extend(Ext.form.Field,{
constructor:function (){
materialSearchBeginSize.superclass.constructor.call(this,{
id:'find_beginSize',
// renderTo:Ext.getBody(),
xtype:'field',
value:'起始值(单位KB)',
listeners:{
focus:function (){
this.setValue("");
},
blur:function (){
if (this.getValue().length == 0){
this.setValue('起始值(单位KB)')
}
}
}
})
}
});
materialSearchEndSize=Ext.extend(Ext.form.Field,{
constructor:function (){
materialSearchEndSize.superclass.constructor.call(this,{
id:'find_endSize',
// renderTo:Ext.getBody(),
// regex:/^[^\d\.]+?$/,
value:'结束值(单位KB)',
listeners:{
focus:function (){
this.setValue("");
},
blur:function (){
if (this.getValue().length == 0){
this.setValue('结束值(单位KB)')
}
},
change:function (thiz,newValue,oldValue){
// alert("--"+newValue.replace(^/[^\d\.]+?/g,''))
}
}
})
}
});
materialSearchEmpty=Ext.extend(Ext.form.Field,{
constructor:function (){
materialSearchEmpty.superclass.constructor.call(this,{
hidden :true
})
}
});
materialfindToolbar = Ext.extend(Ext.Toolbar,{
choiceSearch:null,
choiceSearch1 : null,
constructor:function (){
choiceSearch = new materialSearchFiled();
choiceSearch1=new materialSearchEmpty();
a = new materialSearchBeginSize();
b = new materialSearchEndSize();
materialfindToolbar.superclass.constructor.call(this,{
items : [
{
xtype: 'combo',
triggerAction: 'all',
width:100,
displayField: 'name',
emptyText:"ALL",
id:'materCombo',
store:[
'ALL',
'素材名称',
'大小',
'类型'
],
listeners:{
select:function (combo, record, index){
choiceCombo=index
//alert(index + "--" + record.data.text) // 根据选择的index 生成不同的Field
if (index == 0){
//choiceSearch = new materialSearchFiled();
Ext.getCmp("find_Name").show();
Ext.getCmp("find_beginSize").show();
Ext.getCmp("find_endSize").show();
}
else if (index == 1){
Ext.getCmp("find_Name").show();
Ext.getCmp("find_beginSize").hide();
Ext.getCmp("find_endSize").hide();
}
else if (index == 2){
Ext.getCmp("find_Name").hide();
Ext.getCmp("find_beginSize").show();
Ext.getCmp("find_endSize").show();
}
}
}
}
,new Ext.Toolbar.Separator(),
choiceSearch,
a,b
//choiceSearch1
,{
id:'search_name',
cls:'search',
text:'查询'
},new Ext.Toolbar.Fill(), // 右对齐
{
id : 'materialUplpad',
text : '上传',
aligh : 'right'
}, new Ext.Toolbar.Separator(), {
id : 'materialDel',
text : '删除'
}]
})
}
})
materialGridPanel = Ext.extend(Ext.grid.GridPanel, {
mToolbar : null,
constructor:function (){
this["store"] = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : ''
}),
pruneModifiedRecords : true,
autoLoad: false,
reader : new Ext.data.JsonReader({
root : 'root'
}, [{
name : 'jobno',
type : 'string'
}])
});
mToolbar = new materialfindToolbar();
materialGridPanel.superclass.constructor.call(this,{
renderTo : Ext.getBody(),
// title:'dsf',
tbar : mToolbar,
columns : [{
header : "Job No.",
sortable : true,
dataIndex : "jobno",
width: 150
}]
})
}
})