Ext.define('cbx.com.cbx.app.ui.venue.VenueFrontPage_venueFrontPage', { extend:'cbx.panel.Panel', requires: ['cbx.util.Console'], constructor : function(config) { var me=this; me.renderInProgress = false; me.isUI=true; me.uiUrlPrefix='/ui/'; // margin size for the table layout var margin = 5;//14; cbx.com.cbx.app.ui.venue.VenueFrontPage_venueFrontPage_venuePlanAnEventForm = Ext.create('Ext.panel.Panel', { id: 'contains_venueFrontPage__venuePlanAnEventForm' //TODO nested layouts //,assocComp: '${reg.assocComponent.clientId}' ,border: false ,collapsible: false ,collapsed: false ,layout: 'fit' ,align: 'north' ,defaults: {frame:true, flex: 1} ,regionName:'north' ,listeners:{'beforerender':{fn:function(){this.renderInProgress = true;}}, 'afterrender':{fn:function(){this.renderInProgress = false;}}} }); var cfg = { id: 'venueFrontPage', key: 'cbx.venueFrontPage' ,border:false ,layoutConfig:{animate:false} ,layout: 'fit', margin:"0,0,0,0",defaults: {animCollapse: false,frame:false} , items:[ cbx.com.cbx.app.ui.venue.VenueFrontPage_venueFrontPage_venuePlanAnEventForm ] }; Ext.apply(me, cfg); me.callParent(arguments); }, initComponent: function() { var me=this; me.callParent(arguments); }, beforeDestroy : function(){ Ext.undefine('cbx.com.cbx.app.ui.venue.VenueFrontPage_venueFrontPage'); this.callParent(arguments); } }); Ext.onReady(function(){ var pComp = Ext.getCmp('contains_venueFrontPage'); if (pComp === undefined){ console.error('panel:venueFrontPage pComp=' + pComp); }else{ var me=Ext.create('cbx.com.cbx.app.ui.venue.VenueFrontPage_venueFrontPage'); me.renderInProgress = true; pComp.add(me); me.renderInProgress = false; } }); Ext.define('cbx.venuePlanAnEventForm', { extend:'cbx.form.Panel', requires: ['cbx.util.Console', 'cbx.util.ActionQueue', 'Ext.ux.form.field.BoxSelect', 'Ext.ux.form.field.DateTime'], constructor : function(config) { var me=this; me.dataUrlPrefix='/data/venuePlanAnEventCursor'; me.fileUpload= false; me.dataUrlKeySuffix = ''; var cachePar='cache=client&'; me.cbxBaseParams= cachePar+"columns=partyPlaceType,additionalText" ; me.modelName = 'venuePlanAnEventFormModel'; if(!Ext.ClassManager.isCreated(me.modelName)){ Ext.define(me.modelName, { extend: 'Ext.data.Model', idProperty: '_id', fields: [{name:'_id', mapping:'_id', type:'auto' } ,{name:'_data', mapping:'_data', type:'auto' } ,{name: 'partyPlaceType', mapping: 'partyPlaceType' ,type: 'string' ,allowNull:true } ,{name: 'additionalText', mapping: 'additionalText' ,type: 'string' ,allowNull:true } ]}); } this.views=Ext.create('Ext.util.MixedCollection'); this.views.add('DYNAMIC',[ ]); this.views.add('celebrationCategoryDependencies',[ 'partyPlaceType' ]); this.subStores= Ext.create('Ext.util.MixedCollection'); var sStore, hURL = cbx.AppConst.baseUrl+'/data/', idRec = {name:'_id', type:'auto'}; if(!Ext.ClassManager.isCreated('partyPlaceTypeModel')){ Ext.define('partyPlaceTypeModel', { extend: 'Ext.data.Model', idProperty: '_id', fields: [idRec ,{name: 'key', mapping: 'key' ,type: 'string' } ,{name: 'text', mapping: 'text' ,type: 'string' } ]}); } sStore = Ext.create('Ext.data.Store', { storeId: 'partyPlaceType' ,model: 'partyPlaceTypeModel' ,autoDestroy:true ,proxy: {type: 'ajax', url: hURL + 'uiCursorEnumRestriction/partyPlaceTypeRestriction', pageParam:undefined,startParam:undefined,limitParam:undefined, reader: { type: 'json', rootProperty: 'details', totalProperty: 'totalCount', idProperty: '_id',keepRawData:true}}}); sStore.on('load',this.onSecondaryStoreLoad,this); this.subStores.add('partyPlaceType',sStore); var innerConfig=this.createInnerConfig(); var cfg= { id: 'venueFrontPage__venuePlanAnEventForm' ,key: 'cbx.venuePlanAnEventForm' ,selfTarget:{ type:"ui", name:'venueFrontPage', subName:'venuePlanAnEventForm' } ,serverState: {"cursor":{}} ,border: false ,dataCacheMode:'CLIENT' // ,frame:true ,style: {margin: '14px'} ,autoSave:false ,enterSave:false ,readOnly:false ,autoSaveOnTabChange:false //think about it ,autoRefreshOnTabChange:false ,delayedDataLoad:false ,layout:'fit' ,width:'100%' ,autoHeight:true ,items:[innerConfig] }; Ext.apply(me, cfg); this.callParent(arguments); this.innerForm=this.items.items[0].getForm();//TODO:Find better way ASAP }, initComponent: function() { this.callParent(arguments); this.on('CBX_EVENT',cbx.eventDispatcher.onEvent,cbx.eventDispatcher); }, onStoreLoad : function (store, records,opt){ cbx.console.log("FORM:onStoreLoad : venueFrontPage__venuePlanAnEventForm "); if (this.isActiveCmp){ this.loadInProgress=true; var rawData=store.getProxy().getReader().rawData, jsonLength=rawData.details.length, i, fr=this.innerForm; if(!fr){ cbx.console.error(" venueFrontPage__venuePlanAnEventForm inner form is undefined"); return; } if(jsonLength==0 && this.resetOnLoad){ fr.reset(); }else{ if(opt && opt.params && opt.params.view){ this.resetOnLoad=false; } for(i=0; i< jsonLength ; i++){ if( this.resetOnLoad && fr && this.isActiveCmp){ fr.reset(); } var record = rawData.details[i], v=[], vc=[], kk=0, jj=0, nm, rawValue; nm='partyPlaceType'; rec='partyPlaceType'; rawValue=record[nm]; if(rawValue!==null && rawValue!== undefined){ v[jj++]={id:rec, value:{value:rawValue, displayValue:record[nm+'_txt']}}; } nm='additionalText'; rec='additionalText'; rawValue=record[nm]; if(rawValue!==null && rawValue!== undefined){ v[jj++]={id:rec, value:rawValue}; } nm='_data'; rec='_data'; rawValue=record[nm]; if(rawValue!==null && rawValue!== undefined){ v[jj++]={id:rec, value:rawValue}; } nm='_id'; rec='_id'; rawValue=record[nm]; if(rawValue!==null && rawValue!== undefined){ v[jj++]={id:rec, value:rawValue}; } fr.setValues(v); break; //using only first JSON record } } var msg = rawData.messages; if(msg){ cbx.window.Message.setMsg(msg,this); } var todo = rawData.todo; if(todo){ cbx.util.Actions.processActionSuccess(todo,this); } cbx.console.log('FORM:onStoreLoad : venuePlanAnEventForm is done'); this.updateLayout(); this.loadInProgress=false; this.resetOnLoad=true; store.loadInProgress=false; this.notifyStoreLoaded(store); // if during load operation another load was called we have to do it again if ( this.dirtyData){ this.refreshInt(); }else{ var changed=rawData.changed; if(changed){ this.notifyChanged(changed,Math.min(jsonLength,sfLength)); } } } }, createInnerConfig:function(){ var xrl='x-required-label', labelWidth= 125; var ret ={xtype: 'form', border:false , autoRefreshOnTabChange: false , fileUpload: false ,layout: 'anchor' ,frame: false, componentCls: 'x-updateable-panel x-details-panel' ,cls:'cbx-landing-form' ,autoScroll : false ,fieldDefaults: {hideEmptyLabel: false ,labelAlign:'left' } ,defaults:{border:false } ,dockedItems: [ { xtype: 'container' ,dock: 'bottom', minHeight: '24' ,items: [ {xtype: 'tbtext', cls: 'x-panel-header-text', text:'Explore Party Venues'}, { xtype:'cbx.gallerytoolbar' ,id:'venueFrontPage__venuePlanAnEventForm-bg' ,columns:3 /* { id:"z-n1", name:"n1",src:'http://www.sencha.com/img/20110215-feat-drawing.png', text:'Drawing & Charts' },*/ ,actions:[ { src:'/assets/images/celebration/venue/firstbirthday.jpg' ,id:'venueFrontPage__venuePlanAnEventForm-0' ,name:'firstBirthday' ,text: "First Birthday" ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"initialFilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[{"name":"filter","value":"[{\"attribute\":\"agerange\",\"value\":[\"One Year\"]}]"}],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } , { src:'/assets/images/celebration/venue/funactivity.jpg' ,id:'venueFrontPage__venuePlanAnEventForm-1' ,name:'funActivityPlace' ,text: "Fun Activity" ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"initialFilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[{"name":"filter","value":"[{\"attribute\":\"activitytype\",\"value\":[\"Movies\",\"Amusement Park/Rides\",\"Bumper Cars/Go-karts\",\"Play Spaces/Jump Slides\",\"Indoor Fun Games\",\"Laser Games\",\"Outdoor Fun-Tour\",\"Video Games\",\"Adventure\"]}]"}],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } , { src:'/assets/images/celebration/venue/sports.jpg' ,id:'venueFrontPage__venuePlanAnEventForm-2' ,name:'sportsPlace' ,text: "Sports" ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"initialFilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[{"name":"filter","value":"[{\"attribute\":\"venuetype\",\"value\":[\"Family/Kids Sports\",\"Boat/Yacht\",\"Sports/Health\",\"Country Club/Golf Club\"]}]"}],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } , { src:'/assets/images/celebration/venue/educational.jpg' ,id:'venueFrontPage__venuePlanAnEventForm-3' ,name:'educational' ,text: "Educational" ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"initialFilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[{"name":"filter","value":"[{\"attribute\":\"activitytype\",\"value\":[\"Educational - General\",\"Educational Science-Technology\"]}]"}],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } , { src:'/assets/images/celebration/venue/artparty.jpg' ,id:'venueFrontPage__venuePlanAnEventForm-4' ,name:'artEntertainment' ,text: "Arts" ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"initialFilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[{"name":"filter","value":"[{\"attribute\":\"activitytype\",\"value\":[\"Cooking\",\"Art-Craft\",\"Painting\",\"Shows-Plays\",\"Magic\"]}]"}],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } , { src:'/assets/images/celebration/venue/princessfav.jpg' ,id:'venueFrontPage__venuePlanAnEventForm-5' ,name:'princessFavorite' ,text: "Princess Favorite" ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"initialFilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[{"name":"filter","value":"[{\"attribute\":\"activitytype\",\"value\":[\"Art-Craft\",\"Dance\",\"Painting\",\"Music\",\"Farms\",\"Zoo\",\"Cooking\",\"Shows-Plays\",\"Magic\"]}]"}],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } , { src:'/assets/images/celebration/venue/adultceleb.jpg' ,id:'venueFrontPage__venuePlanAnEventForm-6' ,name:'adultCelebration' ,text: "Adult Celebration" ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"initialFilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[{"name":"filter","value":"[{\"attribute\":\"agerange\",\"value\":[\"21 Years and Above\"]}]"}],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } , { src:'/assets/images/celebration/venue/corporate.jpg' ,id:'venueFrontPage__venuePlanAnEventForm-7' ,name:'corporateTeamBuilding' ,text: "Corporate Team Building" ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"initialFilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[{"name":"filter","value":"[{\"attribute\":\"sportstype\",\"value\":[\"Bowling\",\"Outdoor Games/Paintball\",\"Rock Climbing\",\"Boating\",\"Golf\"]}][{\"attribute\":\"activitytype\",\"value\":[\"Adventure\",\"Outdoor Fun-Tour\",\"Painting\",\"Laser Games\",\"Art-Craft\"]}]"}],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } , { src:'/assets/images/celebration/venue/banquet.jpg' ,id:'venueFrontPage__venuePlanAnEventForm-8' ,name:'banquetPlace' ,text: "Banquet Place" ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"initialFilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[{"name":"filter","value":"[{\"attribute\":\"venuetype\",\"value\":[\"Banquet/Reception Hall\",\"Church/Temple\",\"Non-Profit Org/Club\",\"Country Club/Golf Club\",\"Estate/Mansion/Castle\",\"Fraternal Association Hall\",\"Wedding Chapel\",\"Resort/Spa/Retreat\",\"Auditorium\",\"Museum\",\"Hotel\",\"Gallery\",\"Conference Hall\",\"Restaurant\"]}]"}],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } ] } ] } ] ,items:[{xtype:'hidden',name:'_id',value:'1'} ,{xtype:'hidden',name:'_data',value:'client_data:rO0ABXNyADJjb20uY2J4LmFwcC5jdXJzb3JzLnZlbnVlLlZlbnVlUGxhbkFuRXZlbnRUZW1wbGF0ZQAAAAAAAAABAgAETAAOYWRkaXRpb25hbFRleHR0AA5Mc2NhbGEvT3B0aW9uO0wACGFnZUdyb3VwcQB+AAFMABNjZWxlYnJhdGlvbkNhdGVnb3J5cQB+AAFMAA5wYXJ0eVBsYWNlVHlwZXEAfgABeHBzcgALc2NhbGEuTm9uZSRGUCT2U8qUrAIAAHhyAAxzY2FsYS5PcHRpb27+aTf92w5mdAIAAHhwcQB+AAVxAH4ABXEAfgAF'} ,{layout: {type: 'table', columns: 3 ,tableAttrs: {style: {'table-layout':'fixed', width:'100%'}} ,trAttrs: {vAlign:'top'} ,tdAttrs: {style:{padding: '0px 4px'}}} ,cls:'cbx-landing-filter' ,border:false, items:[ {name:'additionalText' ,fieldLabel:'' ,xtype: 'textfield' ,value: '' ,colspan:1 ,rowspan:1 ,hideLabel:true ,width:'100%' ,emptyText:'Type anything here...' ,enforceMaxLength: true ,maxLength:255 } , {name:'partyPlaceType' ,store:this.subStores.getByKey('partyPlaceType') ,xtype: 'cbx.combo' ,value:{value: '',displayValue:''} ,fieldLabel:'' ,colspan:1 ,rowspan:1 ,width:'100%' ,msgTarget: 'qtip' ,hideLabel:true ,allowBlank:true ,cls:'cbx-filter-drop-down-small Fsize16' ,emptyText:'Place/Activity' ,listConfig:{ maxHeight:Math.min(Ext.getBody().getViewSize().height -200, 600) } ,uiContextParam: {"key":"venueFrontPage","params":{"format":["js"]}} } , { xtype:'button',hideMode: 'visibility' ,scale:'small' ,colspan:1 ,rowspan:1 ,id:'venueFrontPage__venuePlanAnEventForm-planAnEventPagefilter' ,cls:'cbx-search-button' ,text: "Search" ,iconCls:'fa fa-search white Fsize20', icon:'fa fa-search white Fsize20' ,handler:function(){ var this_=this; cbx.util.Actions.createHandler({"action":"planAnEventPagefilter","caller":"venuePlanAnEventForm","validationRequired":true,"showWaitMsg":false,"params":[],"target":{"type":"ui","name":"venueFrontPage","subName":"venuePlanAnEventForm","clientId":"venueFrontPage__venuePlanAnEventForm"}}, this_ ); },scope:this } /* */] } ] }; return ret; }, beforeDestroy : function(){ Ext.undefine('cbx.venuePlanAnEventForm'); this.callParent(arguments); } }); Ext.onReady(venuePlanAnEventForm_onReady = function(){ var fComp = Ext.getCmp('contains_venueFrontPage__venuePlanAnEventForm'); if (fComp){ var me=Ext.create('cbx.venuePlanAnEventForm'); me.renderInProgress = true; fComp.add(me); me.renderInProgress = false; }else{ cbx.console.warn('FORM:contains_venueFrontPage__venuePlanAnEventForm fComp is indefined'); cbx.util.ActionQueue.registerDelayedNorReady(venuePlanAnEventForm_onReady); } }); Ext.onReady(function(){ cbx.util.ActionQueue.flushDelayedNotReady(); }); ///////////////11111111111111111///////////////////////////////