PDA

View Full Version : Combobox first page size



plotyan
15 Dec 2009, 12:43 AM
Hi, first, sorry for my english ))).

I'm using combobox with paging in remote mode. I've set pageSize config property, but the first query always happens with default limit value = 20. Using store's baseParams and/or autoLoad properties does not help.

So, what else do I need to do to set combobox page size correctly? Is there a sample of combobox with remote source and paging?

seek
15 Dec 2009, 1:01 AM
I'm working on combobox too, and I found this example very useful: http://www.extjs.com/deploy/dev/examples/form/custom.html

plotyan
15 Dec 2009, 1:39 AM
2seek: thanks, I've seen that sample. I'm sorry, but I forgot to say, that I can't use direct Store.load(...) call, as they do. I use code generation to generate script, that contains mostly components configuration.

So, the right question is - how can I set first page size for combobox with configuration only?

seek
15 Dec 2009, 2:21 AM
Try (but I'm not sure...) with


Ext.form.ComboBox.override({
getParams: function(q){
var p = {};
if (this.pageSize) {
p['limit'] = this.pageSize;
}
return p;
}
});


Note

pageSize : Number
If greater than 0, a Ext.PagingToolbar is displayed in the footer of the dropdown list and the filter queries will execute with page start and limit parameters. Only applies when mode = 'remote' (defaults to 0).

HTH
Seek

plotyan
15 Dec 2009, 5:54 AM
Ok, seek, thanks, you give me the idea to explore Ext sources closer.

I found that first time combobox makes query with self created parameters, and it creates parameters with default names - "start" and "limit". On the other hand, I use params names overriding with my store - "start" = "Skip" and "limit" = "Take". That's the reason....

seek
15 Dec 2009, 7:08 AM
Thi is the first time I help somebody on this forum! ;)

Condor
15 Dec 2009, 7:29 AM
Link to bugreport (http://www.extjs.com/forum/showthread.php?p=418977#post418977) (with suggested fix).