1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
    jasonlfunk is on a distinguished road

      0  

    Default Unanswered: Twitter iPad App Layout

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,071
    Answers
    3499
    Vote Rating
    852
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    jasonlfunk is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,071
    Answers
    3499
    Vote Rating
    852
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You can use the setLeft method passing in 0.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    jasonlfunk is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,071
    Answers
    3499
    Vote Rating
    852
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should execute setLeft on the component.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    jasonlfunk is on a distinguished road

      0  

    Default


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

  8. #8
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,071
    Answers
    3499
    Vote Rating
    852
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The scope.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    jasonlfunk is on a distinguished road

      0  

    Default


    I'm sorry, I don't understand.

Thread Participants: 1