【问题标题】:Ext js problem - unable to inherit "has-many" by extending modelExt js 问题 - 无法通过扩展模型继承“has-many”
【发布时间】:2021-02-19 11:19:37
【问题描述】:

大家晚上好,

我遇到了 Ext Js (7.2) 模型继承的问题。 我需要创建一个模型并通过继承父级的 has-many 属性来扩展它。 我注意到虽然它扩展的模型没有看到该属性,但有没有人偶然解决了这个问题或知道我该如何克服它?

我附上遇到问题的例子。

示例: https://fiddle.sencha.com/#view/editor&fiddle/3c0h

感谢大家。

【问题讨论】:

    标签: extjs extjs7


    【解决方案1】:

    添加这些代码行来解决您的问题如下:

    var postStore = store.data.items[0].data.posts;
    Ext.Msg.alert('Post', '' + postStore.length + '-' +postStore[0].title, Ext.emptyFn);
    

    【讨论】:

    • 早上好,谢谢您的回复,但这不是我想要的。我的需要是从“MyApp.model.UserExtend”中的“MyApp.model.User”中检索属性“hasMany”。使用建议的解决方案,它从商店而不是模型中获取信息,它也不会使用模型“MyApp.model.User”。
    猜你喜欢
    • 1970-01-01
    • 2015-02-27
    • 1970-01-01
    • 1970-01-01
    • 2017-11-09
    • 1970-01-01
    • 2010-11-07
    • 2017-11-23
    相关资源
    最近更新 更多