Skip to content

Instantly share code, notes, and snippets.

@brian428
Created September 26, 2012 05:05
Show Gist options
  • Save brian428/3786196 to your computer and use it in GitHub Desktop.
Save brian428/3786196 to your computer and use it in GitHub Desktop.
MainController.coffee
Ext.define( "JasmineExample.controller.MainController",
extend: "Deft.mvc.ViewController"
control:
companyGridPanel:
selectionchange: "onCompanySelected"
panel2: {}
config:
currentCompany: null
init: ->
@callParent( arguments )
###*
* Update the title for one of the tab panels
* @param title The new title for the panel.
###
updatePanelTitle: ( title ) ->
@getPanel2().title = title
###*
* Update the current company when the grid selection changes.
* @param selectionModel The type of SelectionModel in use by the grid.
* @param model An array of Model instances that were selected.
* @param index The row index of the selection.
###
onCompanySelected: ( selectionModel, model, index ) ->
@setCurrentCompany( model[ 0 ] )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment