Results 1 to 9 of 9

Thread: Twitter iPad App Layout

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
      0  

    Default Unanswered: Twitter iPad App Layout

    Hello,

    I am coming from the jQuery world and am looking into sencha. I am wondering if it is possible using the stock components of sencha to build an app layout like the Twitter App for Ipad. Basically it consists of a static side bar and two panels that can be dragged around, but snap back into place and can be dragged off screen to drop the panel from the layout. Hopefully you have the app so that my description can make sense.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,318
    Answers
    3883
    Vote Rating
    1291
      0  

    Default

    The only thing you would have to do is the snapping of the panels after dragging and the layouts that panels can be above other panels.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
      0  

    Default

    Thanks for the response. Could you point me to some resources/examples on how to achieve the snapping of panels? For instance, how would I make this panel slide back to 0px from the left after being dragged?

    Code:
    Ext.application({
        name: 'Text',
    
    
        launch: function() {
                Ext.create('Ext.Container', {
                        fullscreen: true,
                        layout: 'hbox',
                        items: [
                                {
                                     xtype: 'panel',
                                     html: 'example',
                                     cls: 'container1',
                                     height: '100%',
                                     left: 0,
                                     draggable: {
                                         direction: 'horizontal',
                                         listeners: {
                                             dragend: function(t,e,x,y) {
                                                  console.log(x+","+y);
                                              }
                                        }
                                     } 
                                }
                        ]
                });
        }
    });

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,318
    Answers
    3883
    Vote Rating
    1291
      0  

    Default

    You can use the setLeft method passing in 0.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
      0  

    Default

    One more hint? I've tired all of the following and none of them worked:

    Code:
    ...
      listeners: {                                         
          dragend: function(t,e,x,y) {                                                                  
    //               Ext.get(t).setLeft(0);
    //               Ext.get(e.target).setLeft(0);
    //               Ext.get(e.target.parent).setLeft(0);
    //               t.getElement().setLeft(0);
    //               t.getElement().getParent().setLeft(0);
    //               this.setLeft(0);
    //               Ext.get(this).setLeft(0);
    //               Ext.get(this).getParent().setLeft(0);
                     Ext.get(t.getId()).setLeft(0);
                   }                                                                                                                                                                                       
        }   
    ...

  6. #6
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,318
    Answers
    3883
    Vote Rating
    1291
      0  

    Default

    You should execute setLeft on the component.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #7
    Sencha User
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
      0  

    Default

    And how do I access the component from within the dragend listener?

  8. #8
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,318
    Answers
    3883
    Vote Rating
    1291
      0  

    Default

    The scope.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  9. #9
    Sencha User
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
      0  

    Default

    I'm sorry, I don't understand.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •