Hi Everyone,
Something unusual going on here and causing a bit of a headache. I have a view of type container that contains other views (lists, panels etc). Here is the code for that view.
Code:
Ext.define('Application.view.Results' , {
extend: 'Ext.Container',
xtype: 'resultspanel',
config: {
id: 'resultspanel', //I put this ID in here
title: 'Groups',
layout: 'card',
fullscreen: true,
items:[
{
xtype: 'resultspanellist'
},
{
xtype: 'grouppanel'
},
{
xtype: 'fixturesresultspanel'
}
],
listeners: {
erased: function(){
//this.destroy();
}
}
},
});
I my controller, when i try to use the animateActiveItem function it doesn't work at all. I am using the built in getter and setter function and referring to the results panel above in the refs config in the controller. The code is below:
Code:
refs: {
results: 'resultspanel',
},
I have written a function to switch the different xtypes contained within the results which is below but unfortunately the getter function getResults() doesn't seem to work, as in nothing happens when I tap that button that should scroll the results panel into view. The code is below
Code:
showResultsView: function(data, index) {
var record = data.getStore().getAt(index);
//This code below here works
Ext.getCmp('resultspanel').animateActiveItem({
xtype: record.data.xtype,
},
{
type:'slide', direction:'left'
});
/* This commented out code here doesn't work
Ext.getCmp('resultspanel').animateActiveItem({ xtype: record.data.xtype,
},
{
type:'slide', direction:'left'
});
*/
},
My preferred approach would be to avoid having to assign IDs to a container as it raises this error
Code:
[WARN][Ext.Component#constructor] Registering a component with a id (`resultspanel`) which has already been used. Please ensure the existing component has been destroyed (`Ext.Component#destroy()`.
Can anyone see where I might be going wrong or is this a known issue in Sencha Touch 2?
Thanks,
Matt