Results 1 to 3 of 3

Thread: function no longer works in 2.1.0-rc2

    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
    Vote Rating

    Default function no longer works in 2.1.0-rc2

    I used to have a horizontal scrolling list in 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: 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.

    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.

    Here is the same code using
    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".
    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>',
            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() {
  , false, false);
    Zipped project (small). In "index.htm" point to y our local sencha installation directory.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


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

    For now you could do this instead of

    this.onAfter('refresh', function() {, false, false);
    }, this, { single : true });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Vote Rating



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