Code:
yx.OrderMgmt.Edit = function(){
return{
// init section
Init : function(){
this.win = new Ext.Window({
title: 'Edit Order',
closeAction:'close',
layout: 'border',
width:800,
height:550,
plain:true,
modal :true,
items: [
{ // north
region:'north',
layout:'border',
height: 120,
items:[
{ // west
region:'west',
title:'Original details',
layout:'fit',
width : 300,
items:[
{}
]
},
{ // center
region:'center',
title:'New details',
layout:'fit',
width: 300,
items:[
{}
]
}
]
},
{ // center
region:'center',
title:'Order Editor',
layout:'border',
items:[
{
region:'west',
layout:'fit',
width:220,
items:[
this.SearchBox=new yx.OrderMgmt.Edit.SearchBox()
]
},
{
region:'center',
layout:'fit',
items:[
{}
]
}
]
}
],
buttons:[
{text: 'Confirm Update',handler:this.ConfirmUpdate,scope:this}
]
});
},
Show : function(obj){
this.Caller = obj;
//if(!this.win)
this.Init();
this.win.show();
}
}}();
yx.OrderMgmt.Edit.SearchBox = Ext.extend(Ext.FormPanel,{
initCombos:function(){
var StartDate = new Date();
this.ddate = new Ext.form.DateField({
fieldLabel:'Date',
//vtype: 'daterange',
//endDateField: RDateID,
minValue :StartDate.format("m/d/Y"),
value:"",
triggerAction: 'all'
});
this.destination = new Ext.form.ComboBox({
fieldLabel:'To',
valueField:'destinationid',
displayField:'destination',
emptyText:'Going to...',
lastQuery:'',
mode: 'local',
triggerAction: 'all',
selectOnFocus:true,
typeAhead: true,
store: new Ext.data.SimpleStore({
fields:['originid', 'origin','destinationid', 'destination'],
data:Routes
})
});
},
initComponent: function(){
this.initCombos();
Ext.apply(this,{
//labelWidth: 80, // label settings here cascade unless overridden
//defaults: {width:120},
//title: 'Search',
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
frame:true,
items: [
{
xtype:'fieldset',
title: 'New Travel Details',
autoHeight:true,
width:200,
defaults: {width: 120},
labelWidth :50,
items :[
this.destination,
this.ddate
],
buttons: [
{
text: 'Search',
handler:function(){
},
scope:this
}]
}
]
});
yx.OrderMgmt.Edit.SearchBox.superclass.initComponent.apply(this, arguments);
}
});