Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:02:20+00:00 2026-06-17T16:02:20+00:00

I am using extjs 4.0 and having a combobox with queryMode ‘remote’. I fill

  • 0

I am using extjs 4.0 and having a combobox with queryMode ‘remote’. I fill it with data from server. The problem is that the number of records from server is too large, so I thought it would be better to load them by parts. I know there is a standart paginator tool for combobox, but it is not convinient because needs total number of records.

Is there any way to add dynamic scrolling for combobox? When scrolling to the bottom of the list I want to send request for the next part of records and add them to the list. I can not find appropriate listener to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:02:20+00:00Added an answer on June 17, 2026 at 4:02 pm

    The following is my solution for infinite scrolling for combobox, Extjs 4.0

    Ext.define('TestProject.testselect', {
        extend:'Ext.form.field.ComboBox',
        alias: ['widget.testselect'],
        requires: ['Ext.selection.Model', 'Ext.data.Store'],
    
        /**
         * This will contain scroll position when user reaches the bottom of the list 
         * and the store begins to upload data
         */
        beforeRefreshScrollTop: 0,
    
        /**
         * This will be changed to true, when there will be no more records to upload
         * to combobox
         */
        isStoreEndReached : false,
    
        /**
         * The main thing. When creating picker, we add scroll listener on list dom element.
         * Also add listener on load mask - after load mask is hidden we set scroll into position 
         * that it was before new items were loaded to list. This prevents 'jumping' of the scroll.
         */
        createPicker: function() {
            var me = this,
            picker = me.callParent(arguments);
            me.mon(picker, {
                'render' : function() {
                    Ext.get(picker.getTargetEl().id).on('scroll', me.onScroll, me);
                    me.mon(picker.loadMask, {
                       'hide' : function() {
                          Ext.get(picker.id + '-listEl').scroll("down", me.beforeRefreshScrollTop, false);
                       },
                       scope: me
                    });
                },
                scope: me
            });
            return picker;
        },
    
        /**
         * Method which is called when user scrolls the list. Checks if the bottom of the 
         * list is reached. If so - sends 'nextPage' request to store and checks if 
         * any records were received. If not - then there is no more records to load, and 
         * from now on if user will reach the bottom of the list, no request will be sent.
         */
        onScroll: function(){
            var me = this,
            parentElement = Ext.get(me.picker.getTargetEl().id),
            parentElementTop = parentElement.getScroll().top,
            scrollingList = Ext.get(me.picker.id+'-items');
            if(scrollingList != undefined) {
                if(!me.isStoreEndReached && parentElementTop >= scrollingList.getHeight() - parentElement.getHeight()) {
                    var multiselectStore = me.getStore(),
                    beforeRequestCount = multiselectStore.getCount();
                    me.beforeRefreshScrollTop = parentElementTop;
                    multiselectStore.nextPage({
                        params: this.getParams(this.lastQuery),
                        callback: function() {
                                me.isStoreEndReached = !(multiselectStore.getCount() - beforeRequestCount > 0);
                            }
                    });
                }
            }
        },
    
        /**
         * Took this method from Ext.form.field.Picker to collapse only if 
         * loading finished. This solve problem when user scrolls while large data is loading.
         * Whithout this the list will close before finishing update.
         */
        collapse: function() {
            var me = this;
            if(!me.getStore().loading) {
                me.callParent(arguments);
            }
        },
    
        /**
         * Reset scroll and current page of the store when loading all profiles again (clicking on trigger)
         */
        doRawQuery: function() {
            var me = this;
            me.beforeRefreshScrollTop = 0;
            me.getStore().currentPage = 0;
            me.isStoreEndReached = false;
            me.callParent(arguments);
        }
    });
    

    When creating element, should be passed id to the listConfig, also I pass template for list, because I need it to be with id. I didn’t find out more elegant way to do this. I appreciate any advice.

    {
                        id: 'testcombo-multiselect',
                        xtype: 'testselect',
                        store: Ext.create('TestProject.testStore'),
                        queryMode: 'remote',
                        queryParam: 'keyword',
                        valueField: 'profileToken',
                        displayField: 'profileToken',
                        tpl: Ext.create('Ext.XTemplate',
                            '<ul id="ds-profiles-boundlist-items"><tpl for=".">',
                                '<li role="option" class="' + Ext.baseCSSPrefix + 'boundlist-item' + '">',
                                    '{profileToken}',
                                '</li>',
                            '</tpl></ul>'
                        ),
                        listConfig: {
                            id: 'testcombo-boundlist'
                        }
                    },
    

    And the store:

    Ext.define('TestProject.testStore',{
        extend: 'Ext.data.Store',
        storeId: 'teststore',
        model: 'TestProject.testModel',
        pageSize: 13, //the bulk of records to receive after each upload
        currentPage: 0, //server side works with page numeration starting with zero
        proxy: {
            type: 'rest',
            url: serverurl,
            reader: 'json'
        },
        clearOnPageLoad: false //to prevent replacing list items with new uploaded items
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ExtJS to make a form that generates a report from the data
I'm a newbie using Extjs 4.07. I have created a combobox (remote) queryMode. The
I'm using Extjs 4.0.7 and having a hard time getting a combobox in a
I'm having trouble loading image data into a draggable window using EXT JS. The
I am using ExtJS (3) and just trying to populate a combobox/drop down using
I am using ExtJS to load data to a grid, and I want to
I am having trouble getting a ComboBox in ExtJS to display the dropdown items.
we're using EXTJS 4.0.5 and having some issues with mousewheel scrolling. We've got a
I am using ExtJS 3 here. I would like to populate a formpanel from
im pretty new to extjs and having trouble with it i am using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.