0
votes

I'm trying to build a ExtJs web application. There is a window for user maintenance,a grid is in the window to show user's role. A store links to the grid. I configure all of them in Sencha Architect, so I didn't write any code manually.

But something very interest happens. When I open the same window twice or more. If one grid contains data, they also show in all other opened window. Data is also updated altogether if I update in one window.

Store's data comes from a servlert by using a proxy and xmlreader. Is there anything I missed in grid or store configuration? Or I need to load the store manually when the window is created? Kindly help , thanks

1
Eh.... What is the problem, don't you want to load the data automatically? - Gaurav Joseph
I'm using the same window for create new user and modify existed users. So when I open one existed user window (let's say it window A) and open a new window (window B) to create a new user. Window b will automatically get the grid data from window A. Also If I add, delete or update the data in Window B, it affects in all other windows. So I think maybe all window now are using the same store data or cache or something. Is there any configuration in the store to set it create a new instance every time? - user1779012

1 Answers

0
votes

I think your issue is that all of the windows are using the same store.

What you probably want to do is use a new store for each window, with each store using the same model.

Another approach would be to only allow one window to be open at a time (make the window model when you create it). That way, you can control the store contents on a per window basis.

To make a window modal, in the Controller where you launch the new window, use constrain : true, like this (do not put 'constrain : true' in the View def for this window, put it here, when launching the window):

onChooseNewIpAddress                    : function (button) {
    // Launch the get new ip window.
    Ext.create('Portal.view.GetNewIp', {
        title       : 'Get New IP',
        constrain   : true

    }).show();
 }

David