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%'
});