PDA

View Full Version : ExtJS 4.2 HasMany local query has no filterFn



wmcnamara
13 Mar 2013, 8:20 AM
I'm running into an issue with a ComboBox, I'm rebinding a store to said combobox via a record with a hasMany association (eg the associative store that hasMany generates). the ComboBox is set to queryMode local

After the binding, if you haven't already clicked on the combo-box, the first click after binding the new store, is causing an error.

It appears that the ComboBox, is trying to run some filters, and it doesn't agree with
the auto generated filter for the HasMany store.

the HasMany filter has no filterFn which is causing an error when expanding the ComboBox.


Rundown:
Created 2 Models. and 2 Stores for those models.
Create a 1 to many association between the models.
Create a combobox pointing to the "many's" model store
After the application has been initialized rebind the combobox with a store, to a record from the "owner's" model hasMany store.
Expand the Combobox by clicking or typing.
This should cause the error.

mitchellsimoens
15 Mar 2013, 9:35 AM
So you are binding the hasMany store to the combobox?

wmcnamara
15 Mar 2013, 10:39 AM
Yes I'm binding the hasMany store to the combobox.

Unsure if this is a bug, or if there's a preferred way to load the contents of a hasMany store to a combobox.

rtirbany
14 May 2013, 3:20 PM
did you ever get this to work?
I'm trying to do the same (I think) except I've set up my objects as follows:
1) three models defined, each linked via a 1:M (think country-state-city)
2) using a single store composed of my parent object (should be able to do this, right?)
I am attempting to populate the 2nd combobox after a value is picked from the first. It works fine after the first selection, but selecting another record in the 1st combobox doesn't update the records being displayed in the 2nd combobox (though I can see on the backend that they have updated).
I'm not sure which is the recommended set up, but had considered one more like yours...
still digging....