1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    1
    vollekannehoschi is on a distinguished road

      0  

    Default Unanswered: Hiding paging toolbar of combobox works no more in Ext 4.1

    Unanswered: Hiding paging toolbar of combobox works no more in Ext 4.1


    Hi,

    I want to hide the paging toolbar of a picker (of a combobox) if only one site is in the store.

    I wrote this Code with Ext 4.0.2 to hide the paging toolbar if only on page is visible:
    Code:
    listeners:{
                    expand:Ext.bind(function (comboBox) {
                        var picker = comboBox.getPicker();
                        if (comboBox.store.getTotalCount() > this.pageSize) {
                            // show the paging toolbar completely
                            picker.minWidth = 250;
                            // show paging
                            picker.pagingToolbar.show();
                            // this is a workaround for a bug with the paging toolbar. After updating one comboBox
                             
                            picker.pagingToolbar.doLayout();
                        } else {
                            // set to ext default
                            picker.minWidth = 70;
                            // and hide paging toolbar
                            picker.pagingToolbar.hide();
                        }
                    }, this)
                },
    but this don't work anymore in Ext 4.1! Now I have to click 3 times on the trigger to get the picker shown. On the first click it has the position -9999, -9999 .... Has anyone an idea how to achieve the same goal with more robust code in Ext 4.1?

    Here is my complete combobox:
    Code:
    comboBox = Ext.create('Ext.form.field.ComboBox', {
                displayField:"name",
                valueField:"value",
                emptyText:emptyText,
                store:store,
                queryParam:"searchTerm",
                hiddenName:dimensionId,
                dimensionId:dimensionId,
                listConfig:{
                    loadingHeight:300
                },
                listeners:{
                    expand:Ext.bind(function (comboBox) {
                        var picker = comboBox.getPicker();
                        if (comboBox.store.getTotalCount() > this.pageSize) {
                            // show the paging toolbar completely
                            picker.minWidth = 250;
                            // show paging
                            picker.pagingToolbar.show();
                            // this is a workaround for a bug with the paging toolbar. After updating one combobox
                            picker.pagingToolbar.doLayout();
                        } else {
                            // set to ext default
                            picker.minWidth = 70;
                            // and hide paging toolbar
                            picker.pagingToolbar.hide();
                        }
    
    
                    }, this)
                },
                disabled:true,
                cls:'filter-selectbox combobox',
                forceSelection:true,
                typeAhead:true,
                minChars:0,
                pageSize:this.pageSize,
                anchor:'100%'
            });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,672
    Answers
    3354
    Vote Rating
    747
    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


    Without that listener do you have to still click many times to get the picker? Also is the store already loaded when you try to expand?
    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
    Apr 2012
    Posts
    4
    Vote Rating
    1
    vollekannehoschi is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Without that listener do you have to still click many times to get the picker? Also is the store already loaded when you try to expand?
    Yes and yes. Without that listener it works as expected, one click opens the picker. The store is already loaded when I try to expand it. I load the store with this 2 lines:
    Code:
    comboBox.lastQuery = ""; // set this so comboBox don't load again on first click
    comboBox.store.load(Ext.bind(this.onComboBoxValuesLoaded, this, [comboBox, false], false));

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar