L
L
lfs2012-08-23 16:14:31
JavaScript
lfs, 2012-08-23 16:14:31

How to reuse store in MVC application without multiple reloads?

Good afternoon.
I am writing an MVC application on extjs4.

Unlike the examples on the sencha site, I have a situation where one Store is used several times (for example, on one tab in a combobox, on another in a grid).

Application launches a Viewport that contains a tabpanel.
Each tab has its own controller and many views.

My problem: Store is loaded many times - every time it is mentioned in the controller.
Store configured with autoload: true .
Proxy configured in Model.

If I remove Store from the [stores] array of the taba controller, the combobox will be empty, although it says store:Ext.getStore('STORE-ID') Tell me

in which direction to dig, or an example with reusing Store and not Model

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Necro, 2012-08-23
@Necro

remove autoload: true and call Ext.getStore('STORE-ID').load() once, on initialization, for example

M
Michael, 2012-08-23
@1099511627776

>If I remove Store from the [stores] array of the taba controller, the combobox will be empty, although it says
>store:Ext.getStore('STORE-ID')
Go through the code with the debugger, perhaps in the place where you use getStore('.. ...') it is not yet initialized and cannot be referred to by its name.
and about the question: "How to reuse store" well, I use grid.reconfigure(store,columns) - if the columns in the grid change and then just force store.load

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question