- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个网格链接到一个带有 autoLoad: true
的商店.问题是存储在应用程序启动时加载,即使 View 是在稍后通过菜单访问时才创建的。
我已经在 Application.js 和 View 中引用了商店,但我没有明确说明商店和 View 。
我不知道如何实现仅在 View 需要时才加载商店。
autoLoad: true
,商店在应用程序启动时加载。 autoLoad: false
,商店根本没有被加载。 Ext.define('Mb.store.Owners', {
extend: 'Ext.data.Store',
model: 'Mb.model.Owner',
autoLoad: true,
proxy: {
...
});
Ext.define('Mb.Application', {
name: 'Mb',
extend: 'Ext.app.Application',
models: [
'Owner'
],
stores: [
'Owners'
],
...
Ext.define('Mb.view.winbiz.Owners', {
extend: 'Ext.grid.Panel',
alias: 'widget.test-gridPanel',
store: 'winbiz.Owners',
columns: [{
...
Ext.define('Mb.controller.Winbiz', {
extend: 'Ext.app.Controller',
views: [
'Owners'
],
init: function(){
this.control({
'menu #test': {click: this.onMenuTest},
})
},
onMenuTest: function(){
this.getController('Main').addToMainTab('test-gridPanel');
},
最佳答案
您可以添加 render
处理程序查看哪个将调用存储 load
方法和禁用 autoLoad
.
示例监听器:
Ext.define('Mb.view.winbiz.Owners', {
extend: 'Ext.grid.Panel',
[...],
initComponent: function(){
this.callParent();
this.on('render', this.loadStore, this);
},
loadStore: function() {
this.getStore().load();
}
});
关于extjs - 应用程序启动时不应加载带有 autoload true 的存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19588780/
Kernel#autoload 和 Module#autoload 有什么区别?每个使用的上下文是什么? 最佳答案 正如标准文档中这些方法的源代码所示, Kernel#autoload 电话 Modu
我对 Laravel 4 和 Composer 还是很陌生。当我做 Laravel 4 教程时,我无法理解这两个命令之间的区别; php artisan dump-autoload 和 compose
search() 上的倒数第二项path 是(总是?)一个名为 Autoloads 的环境.关于这个话题,我能找到的只是 R language definition 第 26 页上的一句话。 (PDF
package My::Win32::Console; use warnings; use strict; use parent qw( Win32::Console ); sub new {
我的 MVC 结构如下: - web -- Classes --- Loader.php -- Core --- Controller.php --- Model.ph
本文实例分析了Yii2中YiiBase自动加载类、引用文件的方法。分享给大家供大家参考,具体如下: 在Yii2中这个函数是用来加载类的,没有直接引用文件的相关实现。但是这个也可以用来引用文件。
我是 PHP 自动加载的新手,在我的最新项目中需要 Horde_Text_Diff。我正在使用 Horde_Autoloader 来自动加载所需的文件,但是,我没有正确使用它。据我所知,互联网上没有一
我正在将 Symfonys Autoloader 用于具有以下文件夹/类结构的项目: App +- Package1 | +- Package2 +- Class1.php | - Interfa
我目前正在用 PHP 对我的框架进行编程(主要是出于教育原因,也是一种打发时间的方式)。我编写了一个自动加载器,它会自动扫描目录树并检测其中的所有类,并按以下格式创建一个数组: Array(
我有一个非常有趣的困境。我正在开发 CVS 存储库的 Perl 脚本接口(interface),并创建了 Perl 对象来表示 Modules , Paths , 和 Files .由于Modules
我被困在一个非常基本的问题上: 我正在尝试使用 Laravel,我使用 Composer 安装在我的 Windows 7 上。当我尝试使用 Wamp 在本地访问我的网站时,出现错误: Warning:
我目前正在开发一个需要从其父目录访问类的 Laravel 项目。 Composer .json > PSR-4: "psr-4": { ... "ModuleA
我将下面的代码作为一个自动加载类,但是看起来 clean 方法根本不起作用,它总是退回到 dirty 方法。 我是否错误地使用了 spl_autoload?如果是这样,正确(更好)的方法是什么?这是低
我正在学习 fat free 框架,但我遇到了一个问题。 我试用了 F3 Autoloader 并得到了这个: Internal Server Error Fatal error: Class 'Ga
我正在运行一个 Silex 小应用程序。试图让某种结构继续下去。 这是我的composer.json: { "require": { "silex/silex": "~1.3"
Kernel#autoload记录如下: Registers filename to be loaded (using Kernel::require) the first time that mod
我一直在使用 AUTOLOAD 在 Perl 中创建我的访问器,但我遇到了这种困惑(我已经搜索过 google 和 perldoc)。 我有这个代码: package Class; sub new {
我正在使用 CodeIgniter 4 的最新“master”分支 我有一个要自动加载的库。实际上,我希望拥有“一个”index.php(具有元数据、基本 html 结构等),通过它我可以通过我的"t
我们可以使用Autoloader跟踪是否已从 S3 存储桶加载的文件。我关于 Autoloader 的问题:有没有办法读取 Autoloader 数据库以获取已加载文件的列表? 我可以在 AWS Gl
单步执行供应商提供的库,一个调用是AUTOLOAD'ed,由UNIVERSAL::can() 捕获的coderef,然后调用该coderef。我相信调用是通过 DynaLoader 从已编译的库调用例
我是一名优秀的程序员,十分优秀!