-
24 Sep 2012 1:16 PM #1
Unanswered: problem displaying detail view
Unanswered: problem displaying detail view
Hey Sencha geniuses, I have a problem I was hoping someone can help me with. I have a list and when you click on one of the disclosure icons I have it display a detail view. The problem I have is when I click the disclosure icon it slides into view but nothing displays any idea of what I did wrong. Any help would be awesome.
view/projectContainer
view projectListCode:Ext.define('codename.view.ProjectsContainer', { extend:'Ext.navigation.View', xtype: 'projectsContainer', fullscreen : true, requires:[ 'Ext.dataview.List', 'Ext.data.proxy.JsonP', 'Ext.data.Store', 'codename.view.ProjectsList', 'codename.view.ProjectDetail' ], config: { defaults: { scrollable:true, styleHtmlContent: false }, items: [ { xtype: 'projectList' } ] } });
view projectDetailCode:Ext.define('codename.view.ProjectsList', { extend:'Ext.List', xtype: 'projectList', fullscreen : true, requires:['codename.store.Projects'], config: { itemTpl: '<img src="{ProjectImageUrl}"></img>', store: 'Projects', navigationBar: false, onItemDisclosure: true } });
controller projectCode:Ext.define('codename.view.ProjectDetail',{ extend:'Ext.Panel', xtype:'projectDetails', config: { scrollable:'vertical', styleHtmlContent:true, title: 'Project Details', html: 'FPO' } });
Code:Ext.define('codename.controller.Projects', { extend: 'Ext.app.Controller', config: { refs: { main: 'projectsContainer' }, control: { 'projectList' : { disclose: 'showProjectDetails' } } }, showProjectDetails: function() { alert("test"); this.getMain().push({ xtype: 'projectDetails' }); } });
-
24 Sep 2012 1:35 PM #2
This works just couldnt see my detail view because text was same color as background
This works just couldnt see my detail view because text was same color as background
This works just couldnt see my detail view because text was same color as background. I guess this can serve someone who needs to learn how to add a detail view

-
24 Sep 2012 2:59 PM #3
Does anyone know who to push this view into the main view? Currently the detail view that I slide in appears in the projects container but essentially I need it to take up the full screen but above the tab bar. Any ideas out there?
-
24 Sep 2012 10:30 PM #4
Hi master_obiwan,
instead of pushing your detailView to the projectsContainer, try
If you want to change the view with an animation, e.g. useCode:Ext.Viewport.setActiveItem('projectDetails');
Hope this helps.Code:Ext.Viewport.animateActiveItem('projectDetails', { type: 'slide', direction: 'left' });
Best regards,
Schildi
-
25 Sep 2012 9:12 AM #5
Hi Schildi,
Does this look right to you? Not working for me.
Code:showProjectDetails: function() { Ext.Viewport.animateActiveItem('projectDetails', { type: 'slide', direction: 'left' }); }
-
25 Sep 2012 9:48 AM #6
Hi master_obiwan,
actually that should work...
3 questions:
1. Which specific version of Sencha Touch do you use?
2. Does setActiveItem work?
3. Do you see anything at the console in your browser (errors/warnings/...)?
Best regards,
Schildi
-
25 Sep 2012 4:59 PM #7
Hey Schildi,
no the set active item doesn't work either and the error I get in the console is console[consoleMethod](message);
No errors in console
I am running sencha touch 2.0
-
25 Sep 2012 10:55 PM #8
Hi master_obiwan,
okay, it seems that with your version of Sencha Touch, you cannot use the components xtype as parameter for setActiveItem, as I suggested here:
I'm using Sencha Touch 2.1.0-beta1 and it works for me ;-)Code:Ext.Viewport.setActiveItem('projectDetails');
Nevertheless, you should be able to do something like that then:
Hope that at last this will work :-)Code:Ext.Viewport.setActiveItem( Ext.create('codename.view.ProjectDetail', { // your configs here }) );
Best regards,
Schildi


Reply With Quote