Ext.StoreManager.lookup中的查找未定义(lookup in Ext.StoreManager.lookup is not defined)

编程入门 行业动态 更新时间:2024-10-26 10:32:16
Ext.StoreManager.lookup中的查找未定义(lookup in Ext.StoreManager.lookup is not defined)

这是我的看法:

Ext.define('MyApp.view.Login.LoginForm',{ extend: 'Ext.form.Panel', alias: 'loginForm', requires: ['Ext.form.FieldSet', 'Ext.Img'], config: { items: [ { xtype: 'fieldset', items: [ { xtype: 'textfield', name: 'username', required: true },{ xtype: 'textfield', name: 'password', required: true, inputType: 'password' },{ xtype: 'selectfield', //*****************the problem is here**************** store: Ext.StoreManager.lookup('MyApp.store.Tables') //store: Ext.StoreManager.lookup('Tables') } ] },{ xtype: 'button', text: 'Login', } ] } });

它说它不能使用lookup of undefined ,所以我认为MyApp没有看到Ext.StoreManager。

我也尝试过Ext.data.StoreManager.lookup和Ext.StoreMgr 。 BTW。 商店真的存在。

This is my view:

Ext.define('MyApp.view.Login.LoginForm',{ extend: 'Ext.form.Panel', alias: 'loginForm', requires: ['Ext.form.FieldSet', 'Ext.Img'], config: { items: [ { xtype: 'fieldset', items: [ { xtype: 'textfield', name: 'username', required: true },{ xtype: 'textfield', name: 'password', required: true, inputType: 'password' },{ xtype: 'selectfield', //*****************the problem is here**************** store: Ext.StoreManager.lookup('MyApp.store.Tables') //store: Ext.StoreManager.lookup('Tables') } ] },{ xtype: 'button', text: 'Login', } ] } });

It says that it cannot use lookup of undefined, so I'm thinking that MyApp doesn't see Ext.StoreManager.

I've also tried Ext.data.StoreManager.lookup and Ext.StoreMgr. BTW. the store really exist.

最满意答案

您的商店配置应该是这样的:

Ext.define('MyApp.store.Tables', { extend: "Ext.data.Store", config: { model: "MyApp.model.Table", data : [{ text: "Ed", value: "Spencer" }, { text: "Tommy", value: "Maintz" }] } });

并将其放入LoginForm.js:

{ xtype: 'selectfield', store: 'Tables' }

我测试过了。 它工作正常。

Your store config should be like this:

Ext.define('MyApp.store.Tables', { extend: "Ext.data.Store", config: { model: "MyApp.model.Table", data : [{ text: "Ed", value: "Spencer" }, { text: "Tommy", value: "Maintz" }] } });

And place this into your LoginForm.js:

{ xtype: 'selectfield', store: 'Tables' }

I have tested. It is working fine.

更多推荐

本文发布于:2023-04-27 14:26:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1327214.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:未定义   StoreManager   Ext   defined   lookup

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!