szym
szym

Reputation: 3198

How to reference in Extjs in a view one of two stores with the same name?

I have two stores:

[email protected]

[email protected]

And two views

[email protected]

[email protected]

In each of them I want to reference different Files store. If I put only 'Files' in the views store property

store: 'Files'

then I get the same store in both cases. Putting '[email protected]' doesn't work.

How should I reference them to get the proper store in the second view?

Thanks!

Upvotes: 2

Views: 1379

Answers (1)

sra
sra

Reputation: 23975

That is because of a ExtJS MVC convetion which will do the following:

Split up the FQN by '@' and use the first part as storeId which will override any storeId that is predefined. The MVC is expecting each store to be singleton and don't take credit of any additional namespace if you use the @ syntax that way.

Try to register the stores (views/models) like

stores:['aaa.Files','bbb.Files']

ExtJS will now take care of the namespace but you will need to use it!

So the storeId are now: 'aaa.Files' and 'bbb.Files' which.

Upvotes: 2

Related Questions