Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays Extjs6中字符串映射的模型数组_Arrays_Extjs_Model_Mapping - Fatal编程技术网

Arrays Extjs6中字符串映射的模型数组

Arrays Extjs6中字符串映射的模型数组,arrays,extjs,model,mapping,Arrays,Extjs,Model,Mapping,我们有一个代码示例。我的问题非常相似,我的问题是如何在extjs6中实现同样的功能 在extjs6中,“记录”中不再有“原始”字段。我在论坛上尝试过不同的东西,但我仍然不知道怎么做。此外,我在sencha文档或extjs6论坛中也没有发现任何关于数组映射的内容;在这种情况下,也许我必须使用多个一元关系。我自己弄明白了,它看起来很奇怪,但很有效 Ext.define('App.model.Report', { requires: ['Ext.data.reader.Xml','Ext.data.s

我们有一个代码示例。我的问题非常相似,我的问题是如何在extjs6中实现同样的功能


在extjs6中,“记录”中不再有“原始”字段。我在论坛上尝试过不同的东西,但我仍然不知道怎么做。此外,我在sencha文档或extjs6论坛中也没有发现任何关于数组映射的内容;在这种情况下,也许我必须使用多个一元关系。

我自己弄明白了,它看起来很奇怪,但很有效

Ext.define('App.model.Report', {
requires: ['Ext.data.reader.Xml','Ext.data.soap.Reader', 'App.model.Value'],
extend: 'Ext.data.Model',
fields: [
    {name: 'Name', mapping: 'Name', type: 'string'},
    {name: 'Caption', mapping: 'Caption', type: 'string'}
    {name: 'Comment',   type: 'auto',
    convert: function(value, record) {
        var nodes = Ext.getStore('reportsStore').getProxy().getReader().rawData.querySelectorAll('Comment Value');  
        var arrayItem = [];
        var l = nodes.length;
        for(var i = 0; i < l; i++) {
            var node = nodes[i];
            arrayItem.push(nodes[i].textContent);
        };
        return arrayItem;
    }
    }]
});
Ext.define('App.model.Report'{
需要:['Ext.data.reader.Xml'、'Ext.data.soap.reader'、'App.model.Value'],
扩展:“Ext.data.Model”,
字段:[
{name:'name',mapping:'name',type:'string'},
{name:'Caption',mapping:'Caption',type:'string'}
{name:'Comment',键入:'auto',
转换:函数(值、记录){
var nodes=Ext.getStore('reportsStore').getProxy().getReader().rawData.querySelectorAll('Comment Value');
var arrayItem=[];
var l=节点长度;
对于(变量i=0;i
现在我遇到了一个新问题,我无法为一个“注释”块获取我的“值”,只能为整个SOAP响应获取值,我在文档中没有发现任何有用的内容,我想这里可能有很多有用的关系?但我不明白如何为我的“多”模型配置代理和读取器。对不起我的英语