whiplash
24 Jan 2012, 7:06 AM
app.views.dashboard = new Ext.Panel({
id: 'dashboard',
layout: 'fit',
renderTpl: [
'<tpl>',
'<div class="divTable">',
'<div class="divColumn">',
'<div class="divRow">',
'<div id="btnAMapping" class="activeMapping" />',
'</div>',
'<div class="divRow">',
'<div id="btnHMapping" class="historicMapping" />',
'</div>',
'<div class="divRow">',
'<div id="btnReports" class="reports" />',
'</div>',
'<div class="divRow">',
'<div class="batch" />',
'</div>',
'</div>',
'</div>',
'</tpl>'
],
listeners: {
afterrender: function(c) {
Ext.selectNode(Ext.query('btnAMapping'), 'dashboard').on('click', fred());
// c.el.on('click', function(){
// if(Ext.query("btnAMapping")) {
// console.log(this);
// //viewport.setActiveItem('groupsListContainer', {type: 'slide', direction: 'right'});
//
// }
// });
}
}
});
function fred() just returns an alert, so I can test if my code even reaches that far.
What I want to do is to make the viewport Panel set the groupsListContainer as the active screen, but it says that the viewport is undefined. Hence, I have that code block commented out to try a few other approaches of accessing my new image (acting as a button)
I have tried ....
Ext.selectNode(Ext.query('btnAMapping'), 'dashboard').on('click', fred());
// Also tried this
Ext.query('btnAMapping').addListener('click', function(){alert('Fred');});
Would anyone have any ideas on how I can apply a click event to a div and load a Panel??
Appreciate any help :)
Thanks guys
id: 'dashboard',
layout: 'fit',
renderTpl: [
'<tpl>',
'<div class="divTable">',
'<div class="divColumn">',
'<div class="divRow">',
'<div id="btnAMapping" class="activeMapping" />',
'</div>',
'<div class="divRow">',
'<div id="btnHMapping" class="historicMapping" />',
'</div>',
'<div class="divRow">',
'<div id="btnReports" class="reports" />',
'</div>',
'<div class="divRow">',
'<div class="batch" />',
'</div>',
'</div>',
'</div>',
'</tpl>'
],
listeners: {
afterrender: function(c) {
Ext.selectNode(Ext.query('btnAMapping'), 'dashboard').on('click', fred());
// c.el.on('click', function(){
// if(Ext.query("btnAMapping")) {
// console.log(this);
// //viewport.setActiveItem('groupsListContainer', {type: 'slide', direction: 'right'});
//
// }
// });
}
}
});
function fred() just returns an alert, so I can test if my code even reaches that far.
What I want to do is to make the viewport Panel set the groupsListContainer as the active screen, but it says that the viewport is undefined. Hence, I have that code block commented out to try a few other approaches of accessing my new image (acting as a button)
I have tried ....
Ext.selectNode(Ext.query('btnAMapping'), 'dashboard').on('click', fred());
// Also tried this
Ext.query('btnAMapping').addListener('click', function(){alert('Fred');});
Would anyone have any ideas on how I can apply a click event to a div and load a Panel??
Appreciate any help :)
Thanks guys