Skip to content

Instantly share code, notes, and snippets.

@jforaker
Created April 7, 2014 15:11
Show Gist options
  • Save jforaker/10022140 to your computer and use it in GitHub Desktop.
Save jforaker/10022140 to your computer and use it in GitHub Desktop.
Sencha Touch multiple listeners on XTemplate DOM elements
listeners:{
tap: {
element: 'element',
delegate: '.student-seat .doc-box, .bubble-holder',
fn: function(e){
var me = this;
var url = e.target.name
, name = e.delegatedTarget.textContent
, divClassName = e.delegatedTarget.className
, appbox = "app-box"
, docbox = "doc-box"
, seat = "x-unsized x-button-normal x-button student-seat"
, seatingChartController = CHLK._app.getController('attendance.SeatingChartController');
switch(divClassName){
case docbox :
var me = this,
config = {
title: "Attachment downloaded",
message: name,
buttons: [{
id: 'MsgConfirm',
disabled: false
}],
scope: me
};
Ext.ux.plugin.AutoHideMessageBox.alert(config);
break;
case appbox :
seatingChartController.loadTheApp(url, name);
break;
case seat :
seatingChartController.showCommentPop(this);
break;
}
}
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment