Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3627 in a recent build.
  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    148
    Vote Rating
    10
    pentool will become famous soon enough

      0  

    Default DataView.select() function no longer works in 2.1.0-rc2

    DataView.select() function no longer works in 2.1.0-rc2


    DESCRIPTION:
    I used to have a horizontal scrolling list in 2.0.1.1. It worked. Then in the 2.1 betas it got broken. In the 2.1.0-rc2 I had to switch the list to a dataview in order to be able to scroll horizontally. Now, however, the "select()" function does not select the dataitem.

    PROBLEM:
    DataView.select() function has no effect. In "initialize" I specify to select/hilite the first dataview item. It does not hilite it. The dataview has a class assigned to it for the "selected" state - which changes the selected item's background from gray to white.

    REPRO:
    Here is a working demo using 2.1.0-rc2
    1. After initial page load, all items' background is gray. This is incorrect. The "select()" function was called on the first item (ABOUT), yet it is not hilited.
    2. Click on the first item (ABOUT). Notice nothing happens, since it is already selected. If an item is selected and you click on it again, nothing will happen. This is proof that it's already selected, yet it's not hilited since the "select()" function doesn't work.
    3. Click another item. Notice its background changed to white.
    4. Click the first item (ABOUT) again, notice its background changed to white now.
    5. When you click an item, the "itemtap" even is handled internally. I don't have anything in the code that handles the "itemtap" event.

    IMPORTANT:
    Here is the same code using 2.0.1.1.
    Notice as soon as the page loads, the first item (ABOUT) is hilited (using the select() function). This is not possible in 2.1.0-rc2.

    DataView code. The select() function is being called from "initialize".
    Code:
    Ext.define('Test.view.HList', {
        extend: 'Ext.DataView',
        xtype: 'hlist',
    
    
        config: {
            fullscreen: true,
            height: 128,
            baseCls: 'navbar-list',
            selectedCls: 'navbar-list-item-selected',
            pressedCls: 'navbar-list-item-pressed',
            inline: {
                wrap: false
            },
            scrollable: {
                direction: 'horizontal',
                directionLock: true
            },
            itemTpl: [
                '<div class="navbar-list-items-container">',
                    '<div style="background: transparent url(\'{img}\') 0 0 no-repeat; width: 96px; height: 96px; border: 1px solid #2c2c2c; float: left; margin-right: 16px;"></div>',
                    '<div class="navbar-list-item-text">',
                        '<div class="navbar-list-item-text-title">{title}</div>',
                        '<div class="navbar-list-item-text-copy">{text}</div>',
                    '</div>',
                '</div>'
            ],
            store: {
                fields: ['title', 'text', 'img'],
                data: [
                    { title: 'About', text: 'Read something about us and find out why my name is Trinity. Or Jack? Mary? Handsome? Dr. Who?', img: 'resources/images/nav-about.jpg' },
                    { title: 'Programs', text: 'We created lots and lots of blurry images. We\'re not really sure why. Maybe because they\'re blurry...?', img: 'resources/images/nav-programs.jpg' },
                    { title: 'Locations', text: 'We are here, we are there, we are everywhere! Just check the map if you don\'t believe me.', img: 'resources/images/nav-locations.jpg' },
                    { title: 'Blog', text: 'We wrote all sorts of jibberish, full of typos and spelling errors and put them on WordPress.', img: 'resources/images/nav-blog.jpg' },
                    { title: 'Contact', text: 'No need to dream of close encounters of the third kind. Call us at Re-Mi-Do-Do-So. Operators are standing by.', img: 'resources/images/nav-contact.jpg' }
                ]
            }
        },
    
    
        initialize: function() {
            this.callParent(arguments);
            this.select(0, false, false);
        }
    });
    DOWNLOADS:
    Zipped project (small). In "index.htm" point to y our local sencha installation directory.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,756
    Vote Rating
    828
    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


    Looks like when the items are rendered the selection is not looked at.

    For now you could do this instead of this.select(...)

    Code:
    this.onAfter('refresh', function() {
        this.select(0, false, false);
    }, this, { single : true });
    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
    Jul 2012
    Posts
    148
    Vote Rating
    10
    pentool will become famous soon enough

      0  

    Default


    Thanks!

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