1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    13
    Vote Rating
    0
    andrescifuentesr is on a distinguished road

      0  

    Default Unanswered: carousel bouton

    Unanswered: carousel bouton


    hi
    i know that everybody says the same, but yes, im a newbie. Im building a horizontal carousel and somewhere on one of the carousel items, im going to have a button. I want to make when the user tap the button, it arrives another slide/card that it is not in the carousel. Rightnow, the only solution that i found is to introduce another vertical carousel but it is not what i want. I think its just not that obvius to build a button but on the dock or toolbar.
    Thanks for any help, examples...

    Andres

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Answers
    1
    Vote Rating
    0
    Cesium is on a distinguished road

      0  

    Default


    Hi Andre,

    I too am a Sencha newb but I think this is a fairly easy question. It sounds to me like you just want to switch to a new view when you click a button, right? I'll try and do my best to explain this. The simplest way to do this is:

    1. create a new .js file in your app/view folder, named <viewname> (whatever you want that view to be named)

    2. define the view in that file (see view documentation here).

    3. in your app.js file, add the string '<viewname>' to your views config, or if you haven't set up a views config, do that right inside your app definition like so:

    Code:
    Ext.Application({
        name: 'ExampleApp',
        views: ['<viewname>'],
    4. add a handler to the button you want to bring up the view (see button documentation here) that creates the view, and then sets it as the active item. that would look something like:

    Code:
    handler: function() {
        Ext.Viewport.add(Ext.create('ExampleApp.view.<viewname>'));
        Ext.Viewport.setActiveItem(<index of the view you just created in the viewport>);
    }
    Wiser Sencha Touch gurus may tell you to put that view switching logic inside a controller, but since I'm on a home computer without Sencha installed or any of my Sencha code to verify that I'm giving you proper syntax, I'll leave that to them.

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    13
    Vote Rating
    0
    andrescifuentesr is on a distinguished road

      0  

    Default


    thanks for your answer, i tough i have to continue alone until monday. Efectevely it is a simple question, all that i want is just to tap a button into the carousels dom, and then go to another view that is not in the carousel, i think it is something basic.
    I have already tryed your approach but i got this message:

    Uncaught Error: The following classes are not declared even if their files have been loaded: 'Myapp.view.Main'.

    do you have any ideas?
    thanks and nice saturday night

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Answers
    1
    Vote Rating
    0
    Cesium is on a distinguished road

      0  

    Default


    I've seen that error before, but it's usually preceded by a syntax error somewhere in the mentioned view, because, as the error says, it found your view file, but for some reason wasn't able to read it and make a class out of it.
    If you got another error before that one then that's what you need to worry about fixing, but if there are no other errors, I'm not sure what to tell you without looking at the code.

  5. #5
    Sencha User
    Join Date
    Jun 2012
    Posts
    13
    Vote Rating
    0
    andrescifuentesr is on a distinguished road

      0  

    Default


    indeed i have another error mesage:

    Uncaught TypeError: Cannot call method 'create' of undefined

    I think i'll re-star tomorrow from zero just to recognised the origin. I think i have a problem in my app.js definition.

    Thanks again, ill tell you tomorrow how it is going on

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Answers
    1
    Vote Rating
    0
    Cesium is on a distinguished road

      0  

    Default


    Let me guess: that error comes from your Main view and you forgot to capitalize the "Ext" in "Ext.create". Am I right?

  7. #7
    Sencha User
    Join Date
    Jun 2012
    Posts
    13
    Vote Rating
    0
    andrescifuentesr is on a distinguished road

      0  

    Default


    hi Cesium

    I was trying to clean my code today and to be more in MVC approach. That error is something funny that is doing chrome not only with my application but also with everything, so i don't think it has to be with my app.

    Uncaught TypeError: Cannot call method 'create' of undefined chrome-extension://aonjhmdcgbgikgjapjckfkefpphjpgma/measureIt.js:120

    I would like to show you my code, maybe it's going to be easier, so far i can make a alert message when i tap my button:

    my app.je code

    Code:
    //<debug>
    Ext.Loader.setPath({
        'Ext': 'sdk/src'
    });
    //</debug>
    
    
    Ext.application({
        name: 'demo',
    
    
        requires: [
            'Ext.MessageBox'
        ],
    
    
        views: ['Main', 'Bowie1', 'Bowie2', 'Bowie3'],
        
        phoneStartupScreen: 'resources/loading/Homescreen.jpg',
        tabletStartupScreen: 'resources/loading/Homescreen~ipad.jpg',
    
    
        launch: function() {
    
    
            // Initialize the main view
            Ext.Viewport.add(Ext.create('demo.view.Main'));
        },
    
    
        onUpdated: function() {
            Ext.Msg.confirm(
                "Application Update",
                "This application has just successfully been updated to the latest version. Reload now?",
                function() {
                    window.location.reload();
                }
            );
        }
    });

    this is my main code

    Code:
    Ext.define("demo.view.Main", {
        extend: 'Ext.carousel.Carousel',
        
    	requires: ['Ext.TitleBar',
        			'Ext.carousel.Carousel',
        			'Ext.Img',
    				'Ext.Video',
    				'Ext.MessageBox'],
    
    
        
        config: {
            tabBarPosition: 'bottom',
            
    		items : [
    			
    			{
    			xtype: 'bowie_video',
    			},
    			{
    			xtype: 'bowie_menu',
    			}
    						
    		]
    		
        }
    
    
    
    
    });
    and finally the new view simplify that i want to bring when i tap my button:

    Code:
    Ext.define('demo.view.Bowie3', {
        extend: 'Ext.Panel',
        
        xtype:'bowiepanel',
    
    
        requires: [
            'Ext.carousel.Carousel'
        ],
    
    
        config: {
    
    
      	    layout: {
                type: 'card',
    			
    
    
            },
    
    
            items: {
                xtype: 'image',
                src: 'resources/images/bowie_h.png'
    		}
        }
    });

    I do appreciate any help.

    Thanks

  8. #8
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Answers
    1
    Vote Rating
    0
    Cesium is on a distinguished road

      0  

    Default


    This is just a guess, but that error message sounds like it's coming from an extension that's breaking your internet. Also, it looks like you've left out the code that defines the view where your view-switching button is, which would be helpful to figuring out why things aren't working.

  9. #9
    Sencha User
    Join Date
    Jun 2012
    Posts
    13
    Vote Rating
    0
    andrescifuentesr is on a distinguished road

      0  

    Default


    yes, i think it is and chrome extension that is bugging. and yes, i left the most important part of my code: sorry:

    Code:
    Ext.define("demo.view.Bowie2", {
        extend: 'Ext.Panel',
    
    
        requires: ['Ext.MessageBox'],
        
    	xtype: 'bowie_menu',
    
    
        config: {
    		
    		
    		items : [
    
    
          	{
                xtype: 'container',
                cls : 'card',
                html : '<div class="bowie"><img src="resources/images/bowie_h.png" width="1024" height="768"></div>',
                items: [{
                    xtype: 'image',
                    src: 'resources/images/bowie_h.png',
                    cls: 'btnAction',
                    margin: '0px 0px',
    
    
    				//handler: function() {
    				//   	Ext.Viewport.add(Ext.create('demo.view.Bowie3'));
    				//  	Ext.Viewport.setActiveItem(bowiepanel);
    				// }
    
    
                    listeners: {
                    	tap: function(){                            
     							console.log('bowie');
                        //    Ext.Msg.alert('Tapped', 'tapped default sencha button');
                         }
                    } 
    
    
                   //====================
    			}]
            },  
    
    
    
    
    		]
    		
    //you have here end config		
    		}
    });

  10. #10
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Answers
    1
    Vote Rating
    0
    Cesium is on a distinguished road

      0  

    Default


    Okay first, have you verified that the handler ever actually executes? Because it looks to me from the docs like Ext.Img has no handler config.
    Second, have you tried putting the same code you had in the handler inside the tap listener event? does it work?
    Third, in the line:
    Code:
    Ext.Viewport.setActiveItem(bowiepanel);
    where is the variable "bowiepanel" defined? If you mean this to be a string that references the xtype, that doesn't work with setActiveItem. setActiveItem takes either a numerical index, or an actual object in the container(Viewport in this case).

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi