1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    17
    Vote Rating
    1
    pokiekokie is on a distinguished road

      0  

    Default List disappears

    List disappears


    When an item in a list is clicked, an other card(panel) is made active with information about the item. When the back-button is clicked, the other card is made active and the list is shown.

    But occasionally the list wont show. It happens all the time when i click the first item, go back, click the last item, and then when i click the back-button the list is gone. What can be the cause?

    var store = new Ext.data.JsonStore({
    model : 'Speler',
    sorters: [
    {property: 'positie', direction: 'ASC'},
    ],
    getGroupString : function(record) {
    return record.get('positie');
    },
    proxy : {
    type : 'ajax',
    url : 'spelers.json',
    reader : {
    type : 'json',
    root : 'spelers'

    }
    },
    autoLoad : true

    });



    var spelersList = new Ext.List({

    store : store,
    itemTpl : new Ext.XTemplate(
    '<tpl for=".">',
    '<div class="contact">',
    '{firstName} <strong>{lastName}</strong>',
    '</div>',
    '</tpl>'
    ),

    singleSelect : true,
    grouped : true




    });


    spelersList.on('itemtap', function(dataView, index, item, e){

    var employee = dataView.store.data.items[index].data;
    var template = new Ext.XTemplate(
    '<p>{firstName} {lastName}</p>',
    '<p>Positie: {positie}</p>',
    '<p>Leeftijd: {leeftijd}</p>',
    '<p><img src="{plaatje}"/></p>',
    '<p>Bio: {bio}</p>'

    );
    var str = template.apply(employee);
    spelersDetail.update(str);

    myToolbar.insert(0,backButton);
    myToolbar.doLayout();
    spelersPanel.setActiveItem(1, {type: 'slide', direction: 'left'})
    spelersLijst.doLayout() ;


    });

    var TapHandler = function (button, event){


    spelersPanel.setActiveItem(0);
    myToolbar.remove(0);myToolbar.doLayout();
    console.log(spelersList);

    }

    var backButton = [{
    id: 'backButton',
    xtype: 'button',
    text: 'back',ui: 'back',
    handler: TapHandler

  2. #2
    Ext JS Premium Member
    Join Date
    Jun 2007
    Posts
    104
    Vote Rating
    6
    miroperez is on a distinguished road

      0  

    Default


    Are you doing anything in the detail to make the store items change which might cause the list to refresh? One thing I ran into recently was if you had a Dataview which was populated by a store which had say mulitple lists of arrays and say one of those arrays was bigger than the others. If you scrolled down that dataview with the bigger array, then switched the dataview to the smaller list, the smaller list doesn't show. The reason it doesn't show is because the dataview isn't resetting the scroll that the previous data set has in it. I had to modify the style to move the scroll back to 0 then it showed up again. It was there, you just had to look for in the inspector in Safari - that was how i figure out that the scroll wasn't getting reset so the items were out of view.

  3. #3
    Sencha User Riaz's Avatar
    Join Date
    Sep 2010
    Location
    Sydney, Australia
    Posts
    183
    Vote Rating
    1
    Riaz is on a distinguished road

      0  

    Default


    I have rewritten your partial code. Just inform me whether it is helping you or not.

    Code:
    spelersList.on('itemtap', function (dataView, index, item, e) {
        var employee = dataView.store.data.items[index].data;
    
        new Ext.Panel({
            id: 'idspelersPanel',
            fullscreen: true,
            dockedItems: [{
                dock: 'top',
                xtype: 'toolbar',
                items: [{
                    text: 'BackButton',
                    handler: function () {
                        Ext.getCmp(' idspelersPanel ').destroy(); //[NOTE: when chick 'Back' button]
                    }
    
    
                }]
    
            },
    
    
          ],  // [~END: dockedItems]
            items: [{
                xtype: 'dataview',
                store: new Ext.data.Store({
                    //Codes
                }),
                itemSelector: 'div.users',
    
    
    
    
                tpl: new Ext.XTemplate(
    '<p>{firstName} {lastName}</p>',
    '<p>Positie: {positie}</p>',
    '<p>Leeftijd: {leeftijd}</p>',
    '<p><img src="{plaatje}"/></p>',
    '<p>Bio: {bio}</p>'
               ) //~End ext.xTemplate
            }
    
    
        ]
        })
    
    });

Similar Threads

  1. Replies: 0
    Last Post: 3 Dec 2010, 7:06 AM
  2. ComboBox disappears
    By ukino in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 9 Dec 2008, 1:36 AM
  3. SubMenu disappears
    By blutarsky in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 27 Jun 2008, 5:13 AM
  4. Center Tab disappears
    By pearlkrish in forum Ext.nd for Notes/Domino
    Replies: 1
    Last Post: 28 Apr 2008, 6:22 PM
  5. Resizable Example disappears in IE
    By coldfiltered in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 5 Apr 2007, 10:45 AM

Thread Participants: 2