-
23 Apr 2012 4:24 AM #1
Unanswered: Problem between combobox and store
Unanswered: Problem between combobox and store
Hi,
sorry if I'm not on right section and for the english..
I have a problem with store and dynamic combobox.
My situation is particular so I'll try to explane only one simple example that should reproduce the problem...
I have a combobox with store linked to it. Near that I build a button needed to reload
a store with random different data . All these component are created together at the start of the page.
So you have a select box and the button reload a store that need to populate that combo.
At the first time I click a button, the store is loaded without any problems and the combo is
populated. But if i close the combo and I click again on the button, when I try to reopen the combo,
the "Login.." appear and nothing change..
It doesn't try to make any call (i checked with firebug).
It' only put the wait message. In this situation (mean with open combo), if i try to realod the data, all will be right.
The data have been loaded correctly because i see them, but the loading messages avoid me to click them.
It seems that the combo doesn't know that it has only to display the message without search anything..
Any ideas?
-
23 Apr 2012 7:53 AM #2Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,190
- Vote Rating
- 195
- Answers
- 436
If you close the combo and update the store, the combo has no knowledge of the change.
You will need to tell the combo to load the store again.
Regards,
Scott.
-
23 Apr 2012 8:03 AM #3
Yes, exactly, but i don't know how do it...
Have you an idea???
-
23 Apr 2012 8:38 AM #4Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,190
- Vote Rating
- 195
- Answers
- 436
Have a look at combo.lastQuery
Scott.
-
3 May 2012 12:15 AM #5
I read docs about that and I found the best way to do it should be declaring a beforequery listeners with
delete queryEvent.combo.lastQuery inside it.
I have tried with queryEvent.combo.lastQuery = null; and with delete queryEvent.combo.lastQuery;
But both doesn't work.
The loading still there
-
7 May 2012 3:14 AM #6
Loading gif
Loading gif
No idea about that???
-
7 May 2012 5:07 AM #7Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,190
- Vote Rating
- 195
- Answers
- 436
Please provide some code... that should reset query.
Scott.
-
7 May 2012 5:47 AM #8
I did it from designer.. This is the column
where onHour_typeBeforeQuery is:Code:xtype: 'gridcolumn', renderer: function(value, metaData, record, rowIndex, colIndex, store, view) { store = Ext.getStore('HourTypes'); index = store.findExact('id',value); if (index != -1){ rs = store.getAt(index).data; return rs.text; } return ''; }, id: 'HoursType', dataIndex: 'hour_type_edit_id', flex: 1, text: 'Tipo di ora', field: { xtype: 'combobox', id: 'hour_type', fieldLabel: 'Label', hideLabel: true, forceSelection: true, queryMode: 'local', store: 'HourTypes', valueField: 'id', listeners: { beforequery: { fn: me.onHour_typeBeforeQuery, scope: me }, show: { fn: me.onHour_typeShow, scope: me } } }
Code:onHour_typeBeforeQuery: function(queryEvent, options) { queryEvent.combo.lastQuery = null; }


Reply With Quote