1. #11
    Sencha User arlo.carreon's Avatar
    Join Date
    Jul 2010
    Location
    Orlando, TX
    Posts
    34
    Vote Rating
    0
    arlo.carreon is on a distinguished road

      0  

    Default


    That is awesome! I am glad you got it working. About the issue with the app crashing after an alert, that has to do with the phonegap.js code. You should not include phonegap.js file, it appears to conflict in some way with sencha framework.

    The only reason you would need the phonegap.js file is if you want to access the native maps, compass, accelerometer, camera, etc. Phonegap.js acts as a Javascript API for those native components, so make sure not to include the file if you are not tapping into native components.

  2. #12
    Ext User
    Join Date
    Aug 2010
    Location
    Rome, Italy
    Posts
    50
    Vote Rating
    0
    lteti77 is on a distinguished road

      0  

    Default


    yes but i need to develop an application using sencha and phonegap together...so there is no choice.
    now i have only a problem when the application starts because the text is zoomed out after a second. it's probably due to the fact that the component is rendered and then the text is added (an so adjusted to fit the screen...).
    i fixed this issue by inserting the html text directly inside the panel but that's not what i really wanted... i would prefer the text to be contained in a 'div' and displayed in the container at startup...

  3. #13
    Ext User
    Join Date
    Jul 2010
    Posts
    9
    Vote Rating
    0
    oonox is on a distinguished road

      0  

    Default


    Hi,

    I found an another quickiest syntax.

    Code:
    Ext.setup({
        onReady: function() {
               panel = new Ext.Panel({
    		fullscreen: true,
    		layout: 'card',
    		items:[{xtype:'panel',contentEl:'portrait-container',scroll:'vertical'},
    			   {xtype:'panel',contentEl:'landscape-container',scroll:'false'}]
    		});		  
    		 Ext.EventManager.onWindowResize(setActivePanel);
    	}	  
    });
    
    function setActivePanel(){
         panel.setOrientation(Ext.getOrientation(),window.innerWidth,window.innerHeight);
    };
    Enjoy !

    Thx for all your message.

    Fabien

  4. #14
    Sencha User arlo.carreon's Avatar
    Join Date
    Jul 2010
    Location
    Orlando, TX
    Posts
    34
    Vote Rating
    0
    arlo.carreon is on a distinguished road

      0  

    Default


    That looks awesome!!! Can't wait to try it, I like this better than static width and heights. Thanks for sharing.

    p.s. this was tested with phonegap and ipad simulator correct?

  5. #15
    Ext User
    Join Date
    Jul 2010
    Posts
    9
    Vote Rating
    0
    oonox is on a distinguished road

      0  

    Default


    yes test on the iphone and ipad simulator and device with phonegap.

  6. #16
    Ext User
    Join Date
    Sep 2010
    Posts
    1
    Vote Rating
    0
    calvinjfress is on a distinguished road

      0  

    Default


    Hi

    i'm discovering all the awesomeness offered by sencha, it's really great.
    I get some trouble with phonegap, and i thought i found the solution on this topic, but i can't get your solution to work with the kitchen sink example.
    On this one, the orientation have to deal with the navigation panel, and i don't really get how to make this all work.

    thanks

  7. #17
    Sencha User arlo.carreon's Avatar
    Join Date
    Jul 2010
    Location
    Orlando, TX
    Posts
    34
    Vote Rating
    0
    arlo.carreon is on a distinguished road

      0  

    Default


    Well in our case sencha was not capturing the event of turning the iPad/iPhone sideways. So in order to help sencha recognize the orientation change, we listen to this event:

    Ext.EventManager.onWindowResize(YOUR_HANDLER_FUNCTION_HERE);

    You should create a function to handle this event, and set an alert("Hello orientation change"); in that function.
    Let us know what you get.

  8. #18
    Ext User
    Join Date
    Oct 2010
    Posts
    2
    Vote Rating
    0
    devver is on a distinguished road

      0  

    Exclamation Problem Persists...

    Problem Persists...


    Within the simulator, while using PhoneGap, applying the following code:

    Code:
    panel.setOrientation(Ext.getOrientation(),window.innerWidth,window.innerHeight);
    Within a listener to Ext.EventManager.onWindowResize will seemingly only trigger once. Upon changing the orientation back to portrait mode, the layout doesn't update and becomes clipped on the right side. Placing a debug.log call inside of the handler suggests that the function doesn't so much as fire.

    I speculate that something inside of Ext.lib.Component.doComponentLayout() is the culprit, however I'm not certain.

    Is anyone else seeing this behavior?

    Full code below:

    Code:
            Ext.setup({
                onReady: function() {
                    panel = new Ext.Panel({
            		    fullscreen: true,
            		    layout: 'card',
            		    defaults: {
            		        cls: 'card'
            		    },
            		    items:[{
            		        xtype: 'panel',
                            html: "Panel One",
            		        scroll: 'vertical'
            		    },{
            		        xtype: 'panel',
                            html: "Panel Two",
            		        scroll: 'false'
            		    }]
            		});
    
                    Ext.EventManager.onWindowResize(setActivePanel);
            	}	  
            });
    
            function setActivePanel() {
                debug.log("Orientation changed to: " + Ext.getOrientation()); 
                panel.setOrientation(Ext.getOrientation(),window.innerWidth,window.innerHeight);
            };

  9. #19
    Ext User
    Join Date
    Aug 2010
    Location
    Rome, Italy
    Posts
    50
    Vote Rating
    0
    lteti77 is on a distinguished road

      0  

    Default


    i'm having the same problem with a tab panel. the window resize event triggers only once.

  10. #20
    Ext User
    Join Date
    Oct 2010
    Posts
    2
    Vote Rating
    0
    devver is on a distinguished road

      0  

    Default Solution

    Solution


    Here's a bit of a solution.

    First, inside of Ext.onReady listen directly for the orientationChanged event, like so:

    Code:
    document.addEventListener("orientationChanged", function() {
        setTimeout(setOrientation, .125);
    });
    Later in your JS, define the setOrientation function:

    Code:
    function setOrientation() {
        panel.setOrientation(Ext.getOrientation(),window.innerWidth,window.innerHeight);
    };
    The setTimeout duration is pretty arbitrary, but it seems to work fine with a mildly complex setup - your mileage may vary.

Similar Threads

  1. Conflict wit sencha / phonegap & html5 database
    By erneso.laval in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 11 Jul 2011, 7:13 PM
  2. Preventing orientation changes?
    By SuperTron in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 19 Jul 2010, 11:20 AM
  3. sencha touch list store problem
    By reminder in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 27 Jun 2010, 11:33 AM
  4. Tab Orientation
    By garyrgi in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 7 Nov 2006, 9:49 AM

Thread Participants: 19

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar