在 ExtJs 6.0 中,有其他方法可以在不使用 autoLoad 的情况下在 Component 中加载数据吗?单击事件后,我想在其上加载数据

问题描述 投票:0回答:0

这里是我的商店没有使用 autoLoad

 Ext.define('Movie.store.UsersStore', {
        extend: 'Ext.data.Store',
        alias: 'store.users',
        storeId: 'usersStore',
        model: 'Movie.model.UsersModel',
        identifier: 'sequential',
        proxy: {
            type: 'rest',
            api: {
                read: 'https://localhost:44369/Users/GetUsers',
                create: 'https://localhost:44369/Users/AddUsers',
                update: 'https://localhost:44369/Users/EditUsers',
                destroy: 'https://localhost:44369/Users/DeleteUsers'
            },
            reader: {
                type: 'json',
                headers: { 'Accept': 'application/json' },
            },
            writer: {
                type: 'json'
            }
        }
    });
    **To display data on window and not uusing autoload heres my code**
       setting: function () {
                var type =Ext.util.Cookies.get("type");
              if(type==1){
                var store = Ext.create('Movie.store.MovieStore', {});
                store.load({
                    scope: this,
                    callback: function (rec,op,success) {
                        var data = (store.getData().getSource() || store.getData()).getRange();
                        console.log(data);
                        var panel =   Ext.create('Movie.view.main.usermenu.adminPanel');
                        store.loadData(panel,true);
               
                    }
                })
        }

**我尝试使用 extjs 中的任何东西手动加载数据,但我 无法开始,我不知道如何不使用 autoLoad 来加载数据 在商店**

这些方法都不行

extjs
© www.soinside.com 2019 - 2024. All rights reserved.