Hybrid View
-
6 Feb 2012 12:45 AM #1
Unanswered: Beta1 - Object has no method 'getAnimation' in Panel.js
Unanswered: Beta1 - Object has no method 'getAnimation' in Panel.js
The section of code that this appears around is:
The bolded line is the line my JS debugger is telling me that the error is being generated around.Code:var Docs = Ext.create('Ext.TabPanel', { id: 'Docs', layout: { type: 'vbox', align: 'stretch' }, defaults: { flex: 1, itemTpl: '{name}' }, ui: 'Filters', items: [{ xtype: 'list', title: 'Tests/Charts', store: RefTests, listeners: { itemtap: function() { MyApp.Viewport.setActiveItem('Tests', {type: 'slide', direction: 'left'}); } } },{ xtype: 'list', title: 'Statements', store: RefStatements, listeners: { itemtap: function() { MyApp.Viewport.setActiveItem('Statements', {type: 'slide', direction: 'left'}); } } }], dockedItems: [{ xtype: 'toolbar', cls: 'Secondary', dock: 'bottom', items: [{ xtype: 'button', text: 'Close', handler: function() { MyApp.Viewport.setActiveItem('Dashboard', {type: 'slide', direction: 'down'}); } }] }], listeners: { activate: function() { ToolbarGlobal.setTitle('Docs'); } } });
The app I am working on was initially written for ST1, and I am converting it to ST2 (beta release).
I am a ST n00b though, so trying to work my way through it.
Thoughts?
Edit1: For what it's worth, it says the error occurs on line 163 in Panel.js.
-
6 Feb 2012 6:49 AM #2
Try commenting out the layout portion of the panel and see if that helps
-
6 Feb 2012 7:14 AM #3
That actually does help.
How do I use the layout attribute though?
-
6 Feb 2012 8:57 AM #4
suppose you have a card layout panel
To set another panel as active changing the transition animation you should writeCode:var pnl = Ext.widget('panel',{ layout: { type: 'card', animation: { type: 'flip' } }, items: [ { xtype: 'container', html: 'First Panel' } ] });
This will allow you to first change your panel layout animation and then set the new wanted active item.Code:pnl.getLayout().setAnimation({ type: 'slide', duration: 1000 }); pnl.setActiveItem(pnl2);Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
7 Feb 2012 3:37 AM #5
I am not sure that I am doing this right, because that doesn't work for me...so this is what I am doing:
What am I missing?Code:var Docs = Ext.create('Ext.TabPanel', { id: 'Docs', layout: { type: 'vbox', align: 'stretch' }, defaults: { flex: 1, itemTpl: '{name}' }, ui: 'Filters', items: [{ xtype: 'list', title: 'Tests/Charts', store: RefTests, listeners: { itemtap: function() { Docs.getLayout().setAnimation({ type: 'slide', direction: 'left' }); MyApp.Viewport.setActiveItem('Tests'); } } },{ xtype: 'list', title: 'Statements', store: RefStatements, listeners: { itemtap: function() { Docs.getLayout().setAnimation({ type: 'slide', direction: 'left' }); MyApp.Viewport.setActiveItem('Statements'); } } }], dockedItems: [{ xtype: 'toolbar', cls: 'Secondary', dock: 'bottom', items: [{ xtype: 'button', text: 'Close', handler: function() { Docs.getLayout().setAnimation({ type: 'slide', direction: 'down' }); MyApp.Viewport.setActiveItem('Dashboard'); } }] }], listeners: { activate: function() { ToolbarGlobal.setTitle('Docs'); } } });Last edited by marc.gayle; 7 Feb 2012 at 3:38 AM. Reason: Updated syntax
-
7 Feb 2012 5:28 AM #6
You are trying to set a "vbox" layout type on a TabPanel.
TabPanel widgets have a "card" layout type by default.
The setAnimation method works only on Panels or TabPanel which have "card" layout type.
From your code I also see some other things that are not going to work on B1, like "dockedItems" for instance.Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata


Reply With Quote