J
J
jet222016-03-09 18:06:23
JavaScript
jet22, 2016-03-09 18:06:23

How to set custom name when binding form and model in ext js?

Hey! There is a project on ext js 6. I'm new to it, I smoked docks, experimented, but did not understand. The essence of the problem, there is a form with fields in which there is a binding to the model.
Form fields:

{
     xtype: 'checkboxfield',
     fieldLabel: 'Field1',
     bind: '{someField1}'
},
{
     xtype: 'textfield',
     fieldLabel: 'Field2',
     bind: '{someField2}'
}

Model fields:
{
            name: 'someField1',
            type: 'boolean',
            mapping: 'some_field_1'
        },
        {
            name: 'someField2',
            type: 'string',
            mapping: 'some_field_2'
        },

As I understand it, each field described in the model is transmitted to the server, and the "name" key describes this field.
But the question is, what if I need to describe several fields in the model with the same names? But after all, the form field binding occurs by name, and the interpreter simply will not understand which field I need if I specify the same
ones . I need the fields in the model to have, for example, different names, but go to the server with the same value. Is it possible to specify this?
Because a response comes from the server, and "mapping" picks up the model field and inserts it into the form field. But on the contrary, it is not the value specified in "mapping" that is transmitted, but the value specified in "name". Help me figure it out please)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question