Ext.define("MyApp.Application",{name:"MyApp",extend:Ext.app.Application,views:[],controllers:[],stores:[]});Ext.define("MyApp.controller.LogController",{extend:Ext.app.Controller,refs:[{ref:"gridpanel",selector:"#gridpanel"},{ref:"searchField",selector:"#searchField"},{ref:"viewlogGridPaging",selector:"#viewlogGridPaging"},{ref:"mypagingtoolbar",selector:"#mypagingtoolbar"}],init:function(a){this.control({"#searchField":{specialkey:function(c,b){if(b.getKey()==b.ENTER){this.search()}}},"#viewlogGridPaging":{specialkey:function(c,b){if(b.getKey()==b.ENTER){this.search()}},select:function(){this.search()}}});this.control({"#refresh":{click:function(){this.getGridpanel().getStore().getProxy().extraParams.filter="";this.getGridpanel().getStore().load();this.getRefresh().blur()}}});this.control({"#removedeleted":{click:function(){this.hideDeleted()}}})},onLaunch:function(){var a=this;this.getSearchField().onTriggerClick=function(b){a.search()}},search:function(){var a=parseInt(this.getViewlogGridPaging().getValue(),10);this.getGridpanel().getStore().pageSize=a;this.getGridpanel().getStore().getProxy().extraParams.filter=this.getSearchField().getValue();this.getGridpanel().getStore().load()}});Ext.define("MyApp.controller.Main",{extend:Ext.app.Controller});Ext.define("MyApp.model.LogEntry",{extend:Ext.data.Model,fields:[{name:"id"},{name:"control_id"},{name:"control_name"},{name:"action"},{name:"field"},{name:"value_old"},{name:"value_new"},{name:"user"},{name:"timestamp"}]});Ext.define("MyApp.store.GetLogStore",{extend:Ext.data.Store,constructor:function(a){var b=this;a=a||{};b.callParent([Ext.apply({autoLoad:true,model:"MyApp.model.LogEntry",remoteFilter:true,storeId:"GetLogStore",leadingBufferZone:50,pageSize:50,proxy:{type:"ajax",url:"../../service/control_log.php",reader:{type:"json",root:"result"}},listeners:{beforeload:{fn:b.onJsonstoreBeforeLoad,scope:b}}},a)])},onJsonstoreBeforeLoad:function(b,a,c){b.proxy.extraParams.paged=true;var e=Ext.Object.fromQueryString(document.location.search);var d=b.proxy.extraParams;var f=Ext.Object.merge(e,d);b.proxy.extraParams=f}});Ext.define("MyApp.view.Main",{extend:Ext.container.Container,xtype:"app-main",layout:{type:"border"},items:[{region:"west",xtype:"panel",title:"west",width:150},{region:"center",xtype:"tabpanel",items:[{title:"Center Tab 1"}]}]});Ext.define("MyApp.view.ViewLog",{extend:Ext.panel.Panel,height:537,itemId:"mypanel",width:1132,header:false,title:"Change Log",layout:{type:"vbox",align:"stretch"},initComponent:function(){var a=this;Ext.applyIf(a,{items:[{xtype:"fieldset",flex:5,margin:"5 12 15 12",layout:"fit",title:"Log",items:[{xtype:"gridpanel",border:false,itemId:"gridpanel",header:false,title:"My Grid Panel",disableSelection:true,store:"GetLogStore",columns:[{xtype:"gridcolumn",hidden:true,dataIndex:"id",text:"ID"},{xtype:"gridcolumn",dataIndex:"control_id",text:"ID"},{xtype:"gridcolumn",dataIndex:"control_name",text:"Name",flex:1},{xtype:"gridcolumn",dataIndex:"action",text:"Action"},{xtype:"gridcolumn",dataIndex:"field",text:"Field",flex:1},{xtype:"gridcolumn",dataIndex:"value_old",text:"Old value",flex:1},{xtype:"gridcolumn",dataIndex:"value_new",text:"New value",flex:1},{xtype:"gridcolumn",dataIndex:"user",text:"User",flex:1},{xtype:"gridcolumn",dataIndex:"timestamp",text:"Timestamp",flex:1}],dockedItems:[{xtype:"pagingtoolbar",dock:"bottom",itemId:"mypagingtoolbar",width:360,displayInfo:true,store:"GetLogStore",items:[{xtype:"combobox",itemId:"viewlogGridPaging",width:50,labelSeparator:" ",value:50,maskRe:/[0-9]/,autoSelect:false,queryMode:"local",store:[50,100,250,500,1000,5000],valueField:"pagesize"},{xtype:"tbspacer",width:3},{xtype:"label",text:"per page"},{xtype:"triggerfield",itemId:"searchField",fieldLabel:"Search",labelAlign:"right",labelSeparator:" ",triggerCls:"x-form-search-trigger"}]}]}]}]});a.callParent(arguments)}});Ext.define("MyApp.view.Viewport",{extend:Ext.container.Viewport,layout:{type:"fit"},items:[{xtype:"app-main"}]});