Compass.ErpApp.Organizer.Applications.BillPay.loadExtensions = function(){ //add Bill Pay tab to individuals tab panel var individualsTabPanel = Ext.getCmp('individualsTabPanel'); individualsTabPanel.add({ title:'Bill Pay', xtype:'billpay_accountsgridpanel', columns: [ { header:'Account Number', sortable: true, dataIndex: 'account_number' }, { header:'Payment Due', sortable: true, width:150, dataIndex: 'payment_due' }, { header:'Next Billing Date', sortable: true, width:150, dataIndex: 'billing_date' }, { header:'Next Payment Due', sortable: true, dataIndex: 'due_date' }, { menuDisabled:true, resizable:false, xtype:'actioncolumn', header:'Make Payment', align:'center', width:100, items:[{ icon:'/images/icons/creditcards/creditcards_16x16.png', tooltip:'Make Payment', handler :function(grid, rowIndex, colIndex){ var rec = grid.getStore().getAt(rowIndex); var makePaymentWindow = Ext.create("Compass.ErpApp.Organizer.Applications.BillPay.MakePaymentWindow",{ amount:rec.get('payment_due'), accountId:rec.get('id') }); makePaymentWindow.show(); } }] }, { menuDisabled:true, resizable:false, xtype:'actioncolumn', header:'Account Details', align:'center', width:100, items:[{ icon:'/images/icons/about/about_16x16.png', tooltip:'View Account Details', handler :function(grid, rowIndex, colIndex){ var rec = grid.getStore().getAt(rowIndex); var accountId = rec.get('id'); var billPayLayout = Ext.getCmp('billpay_layout'); billPayLayout.loadAccountDetails(accountId); var accountsGridPanel = billPayLayout.query('billpay_accountsgridpanel')[0]; accountsGridPanel.getStore().load({ params:{ account_id:accountId, start:1, limit:1 } }) Compass.ErpApp.Organizer.Layout.setActiveCenterItem('billpay_layout', false); } }] }, { menuDisabled:true, resizable:false, xtype:'actioncolumn', header:'Delete', align:'center', width:60, items:[{ icon:'/images/icons/delete/delete_16x16.png', tooltip:'Delete', handler :function(grid, rowIndex, colIndex){ var rec = grid.getStore().getAt(rowIndex); grid.deleteOrder(rec); } }] } ], listeners:{ activate:function(grid){ var contactsLayout = grid.findParentByType('contactslayout'); if(!Compass.ErpApp.Utility.isBlank(contactsLayout.partyId)){ var store = grid.getStore(); store.proxy.extraParams.party_id = contactsLayout.partyId; store.load({ params:{ start:0, limit:10 } }) } } } }); };