1
votes

I am using the list and when the item in the list is tapped it will push the new view with the list of items.but when I click on back button on the new view to go back to list and try to tap on the second item on the list .. it showing the following error

Uncaught TypeError: Cannot call method 'getScroller' of undefined

here is my view

   Ext.define('Sample.view.MSDSItems', {
       extend: 'Ext.Container',
       requires: ['Ext.List'],

       xtype: 'itemlist',

    config: {
        scrollable: {
       scroller: {
           disabled:true
       }
    }, 

        layout:{ type: 'fit'},
        items: [{
            xtype: 'toolbar',
            docked: 'top',
            style:'background:darkgray',

            items: [{
                 xtype: 'searchfield',
                 placeHolder: 'Filter or search... '
            }, {
                xtype: 'button',
                iconCls: 'search',
                iconMask: true,
                ui: 'confirm',
                action: 'search'
            }, {
                xtype: 'spacer'
            }, {
                xtype: 'button',
                iconCls: 'add',
                iconMask: true,
                ui: 'action',
                action: 'add'
            }]
        }, {
        xtype:'list',
        store: 'ItemStore',
        onItemDisclosure: true,
            emptyText: 'No data found!',
         itemTpl : [
                 '<p>{ITEM}</p>',
              ].join('')
         }],
}
});

Please help me .. I tried a lot but not at all working .. I am using Sencha2.2.1

Here is my Controller this is the view(itemlist) that shows when the button is tapped in the main view(I the view that I gave in the code)

myITEMSFunction: function(button,index,target,record) { 
    var navigationView1 =button.up('navigationview'); 

    navigationView1.push({ 
        xtype:'itemlist', 
        title: 'ITEMS', 
        record:record
 });

this is view that shows when the item is tapped from the above list and it works but when I clicked the back and try to tap the other item in the list.. error raises

onMSDSLISTItemtap: function(list, index, target, record){

    var navigationView2 = list.up('navigationview');
    navigationView2.push({

    xtype: 'mymsdsitemslist',
    title: record.data.ITEM,
    record:record
});

here is the logic..it is coming from in-built List.js function not from my controller

doRefresh: function() {
    var me = this,
    infinite = me.getInfinite(),
    scroller = me.container.getScrollable().getScroller(),
    Uncaught TypeError: Cannot call method 'getScroller' of undefined
    storeCount = me.getStore().getCount();
}
1
Please if you want to be helped indent properly your code, and don't post long pieces of code inside comments ;)Andrea Casaccia

1 Answers

0
votes

Please provide the logic that is throwing the error, it looks to be somewhere in the controller.

Edit:

I have not seen any documentation that uses that notation for disabling scrollable.

  scrollable: {
        scroller: {
              disabled:true
         }
  }, 

Have you instead tried scrollable : false?