View Full Version : AutoScroll items inside multiselect (multiselect-demo.html)

23 Nov 2011, 9:31 AM
Hi everyone!
I have a little problem with multiselect scroll. When I move item inside multiselect it moves, but it hides when it goes down.
How can i do that selected item, has been visible all-time in boundlist. And bound list automatically scroll when item goes to the end of visible zone.
I tried :

var list = Ext.get('listView');
listViewBody = list.el.child('.x-boundlist');
listViewBody.scroll('down', 50);

but it said no scroll function.
Have you any suggestion to do this?
Here is how it look like:

23 Nov 2011, 11:54 AM
You need to get the element with the selector 'div.x-boundlist-list-ct' under the correct list. Then you can do this:

el.scroll('b', 50);

Using the MultiSelect example that comes with the download, I was able to scroll doing:

var cmp = Ext.getCmp('itemselector-field'),
list = cmp.toField,
el = list.el.down('div.x-boundlist-list-ct');

el.scroll('b', 50);

24 Nov 2011, 3:12 AM
Thank you very much mitchellsimoens (http://www.sencha.com/forum/member.php?22216-mitchellsimoens)!
It was very helpfull. But I also make same changes to make it work.
var mylist = this.toField,
el = mylist.el.down('div.list-ct');
el = mylist.boundList.listEl
el.scroll('b', 20);

var cmp = Ext.getCmp('itemselector-field'),
list = cmp.toField,
el = list.el.down('div.list-ct');
el.scroll('b', 50);

or inside down button i use

this.toField.boundList.listEl.scroll('b', 50);

Thanks for help! ;)