简体   繁体   中英

The grid store doesn't refresh in ExtJS 5

I have one store and two gridViews (grid1 and grid2) in my web application. I need to load grid2 with grid1's store after grid1 loaded. I know there is many examples on internet for this case but I cannot done it. There is my code below to bind gridView2.

grid2.setStore(storeGrid1);
grid2.getStore().commitChanges();
grid2.getView().refresh;

Note: In fact grid2's store is changing (I checked it with browser's inspect element mode).

Data is binding but They don't seen on user interface. Other answers are about with Ext JS4, may be my code is doesn't work because of it. Is there anyone can help me?

如果您正确设置了grid2的存储,则可以像这样刷新视图:

grid2.getStore().load(); // refresh store -> refresh view

You can also chain stores in your viewModel, then bind them.

Look at the ExtJS 5 chainedStores example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM