0

Here we have example of code. My problem is very similar and my question is how can I do the same in extjs6?

We do not have 'raw' field in 'record' anymore in extjs6. I've tried different things from forums but I still don't understand how to do it. Also I found nothing about arrays mapping in sencha docs or extjs6 forum; maybe I have to use manyToOne relations in this case.

1 Answer 1

0

I figure it out for myself, it looks strange but it works...

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;
    }
    }]
});

And now i have a new problem, i can't get my 'Value' for one 'Comment' block, only for whole SOAP response, i have found nothing useful in docs, and i think maybe manyToOne relations could be useful here? but i do not understand how i should configure proxy and reader for my 'many' model. Sorry for my English.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.