gpt4 book ai didi

javascript - 如何从 extjs4 中的商店获取值

转载 作者:行者123 更新时间:2023-11-30 05:51:14 25 4
gpt4 key购买 nike

我有一个从 zend 服务器获取数据的商店。我想获取商店记录以对我的表单进行一些自定义。为了从商店获取数据,我使用以下代码。

var index = Ext.StoreMgr.lookup('product.AttributeComboBox').find('abbr',4);
var reco = Ext.StoreMgr.lookup('product.AttributeComboBox').getAt(index);

上面的代码片段没有返回任何记录。请让我知道我哪里错了。

最佳答案

  1. 在您的调试器中检查商店是否存在

    Ext.StoreMgr.lookup('product.AttributeComboBox')

  2. 检查存储中有多少条记录

    Ext.StoreMgr.lookup('product.AttributeComboBox').data.items

  3. 检查记录是否正确解析

服务器记录的内容

Ext.StoreMgr.lookup('product.AttributeComboBox').data.items[0].raw

它是如何转化为记录的

Ext.StoreMgr.lookup('product.AttributeComboBox').data.items[0].data

关于javascript - 如何从 extjs4 中的商店获取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14751253/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com