Results 1 to 3 of 3

Thread: Sliding (Swipe-able) dataview with horizontal scrolling

  1. #1
    Sencha User
    Join Date
    Jan 2015
    Posts
    18
    Answers
    1

    Default Sliding (Swipe-able) dataview with horizontal scrolling

    Hello everyone,

    I am trying to create a horizontal scroll list which can be swiped left or right (something like Tinder, but with the option to come back to a previous content)

    This is what I am trying to create:
    http://postimg.org/image/5jcurf1q1

    This is what I have been able to get so far:
    http://postimg.org/image/4o7h33w9h/

    What I have done till now to get this is:

    1. Use a dataview
    2. Set inline wrap to false
    Code:
    inline: {
        wrap: false
    }
    3. Set scrollable to 'horizontal'
    Code:
    scrollable: 'horizontal'
    4. and set the following layout:
    Code:
    layout: {
        type : 'vbox',
        pack : 'center',
        align: 'stretch'
    },
    5. CSS set for the dataview:
    Code:
    .dataview-base {
        background-color: #cacacd;
    }
    6. CSS set for the dataview items:
    Code:
    .dataview-item {
       border-right: 1px solid #000;
       border-left: 1px solid #000;
       border-top: 5px solid #59535E;
       border-bottom: 5px solid #59535E;
       padding:20px;
       margin: 0px 20px 0px;
    }

    How can I achieve what I am trying to achieve ? I am pretty sure it has to do with the CSS of the dataview and the dataview items but I am not sure what ?

    Any help would be highly appreciated.



    Here is the complete Main.js view

    Code:
    Ext.define('MyApp.view.Main', {
        extend: 'Ext.Container',
        xtype: 'main',
        requires: [
            'Ext.TitleBar',
            'Ext.DataView'
        ],
        config: {
            tabBarPosition: 'bottom',
            items: [
                {
                    xtype: 'dataview',
                    height: '100%',
                    styleHtmlContent: true,
                    inline: {
                        wrap: false
                    },
                    itemCls: 'dataview-item',
                    baseCls: 'dataview-base',
                    itemTpl: [
                        '<div class="arHeadline">',
                        '    {Headline}',
                        '</div>',
                        '<div class="arbyline">',
                        '    {Author}',
                        '</div>',
                        '<div class="arcontent">',
                        '    {Content}',
                        '</div>'
                    ],
                    store: 'Discovers',
                    scrollable: 'horizontal',
                    layout: {
                        type : 'vbox',
                        pack : 'center',
                        align: 'stretch'
                    },
                },
                {
                    xtype: 'toolbar',
                    docked: 'top',
                    title: 'Summary'
                }
            ]
        }
    });

    Thank you

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    So you want a carousel that is populated from a store?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Jan 2015
    Posts
    18
    Answers
    1

    Default

    Hey mitchellsimoens,Thanks for looking into it.. But I got it working .. Actually I wanted a carousel inside a carousel but was implementing it wrong. Have solved the problem now

Similar Threads

  1. Since 2.3.1 swipe event fires when scrolling, bug not in 2.2.1
    By fokkow in forum Sencha Touch 2.x: Bugs
    Replies: 7
    Last Post: 29 Jul 2014, 4:46 PM
  2. Horizontal Inline DataView not scrolling properly when using a store
    By atkinsonline in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 17 Mar 2014, 8:10 PM
  3. Scrolling panel bounces back to top after swipe
    By ipops in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 23 Feb 2012, 5:53 PM
  4. ExtJS Content sliding/scrolling like Sencha Touch
    By kkris1983 in forum Ext: Discussion
    Replies: 2
    Last Post: 26 Jan 2012, 1:39 AM
  5. Swipe on a Panel with horizontal scroll
    By steve1964 in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 14 Dec 2010, 11:23 AM

Tags for this Thread

Posting Permissions

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