-
14 Apr 2008 3:03 AM #1
[solved]automatic expand combobox in grid
[solved]automatic expand combobox in grid
I know this has been discussed a few times but i found no contribution where it works.
I tried 2 approaches:
First i tried to add an listener to my grid:
The editor is a Ext.form.ComboBox, so i thought this should work but it does not.Code:listeners: { celldblclick: function(o, row, cell, e) { o.getColumnModel().getCellEditor( cell, row).field.expand(); },
My second approach:
I added an listener to my editor (Ext.form.ComboBox), so i could expand my combobox when it gets focus. Again there is no problem of catching the desired event but if i try to expand
the combobox i get the following error:
>>this.list has no properties
I dunno why i get this error. The store of my combobox is autoloaded, so i m pretty sure the list should exist. I tried playin around with mode, lazyRender and loaded the store explicitly but noting helps.
[CODE]
var storestatusrg = new Ext.data.JsonStore({
url: 'rgcbs.php',
baseParams:{typ:'status',langid:1},
root: 'items',
fields: ['id', 'name'],
autoLoad:true
})
cbtyprg = new Ext.form.ComboBox({
store
toretyprg,
triggerAction: 'all',
emptyText:'Bitte w
-
24 Apr 2008 5:55 AM #2
ok...
ok...
...i know everyone is reading the licensing threat so nobody has time... but ... can someone point me in the right direction.

bump!
-
28 Apr 2008 11:13 PM #3
Configure your combobox with a focus listener which calls onTriggerClick
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
29 Apr 2008 6:13 AM #4
Thats what i did in the second example above. And i get an error:
this.list has no properties
See above :/
-
29 Apr 2008 6:27 AM #5
You need to set scope.
What do you think "this" is going to be inside that function?Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
30 Apr 2008 6:52 AM #6
Hmmm... has nothing to do with scope this time... or i am i totally wrong ?
[CODE]
cbtyprg = new Ext.form.ComboBox({
store
toretyprg,
triggerAction: 'all',
emptyText:'Bitte w
-
30 Apr 2008 8:12 AM #7
You have to use lazyRender:false in this case otherwise it only renders the list on focus by adding its own 'focus' listener.
By using the listeners config, you get the first focus listener in, and so find it with no list rendered!Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
30 Apr 2008 8:14 AM #8
[CODE]cbtyprg = new Ext.form.ComboBox({
store
toretyprg,
triggerAction: 'all',
emptyText:'Bitte w
-
30 Apr 2008 8:41 AM #9
@Animal: Thx, but i couldnt get it work with lazyRender:false, still needed a delay...
Thx Cronos ... just as i found a solution...
... i saw your code and it also works like a charm.Code:listeners: { focus :{scope:this, fn:function(field) { field.onTriggerClick(); },buffer:200} }
Thx a lot you 2
-
5 Feb 2013 2:21 AM #10
Thank it helps.
Thank it helps.
combo box automatically expanded after applying your code on Ext.onReady()





Reply With Quote