Results 1 to 2 of 2

Thread: Form problem, Databind values using ajax proxy

  1. #1
    Sencha User
    Join Date
    Aug 2017
    Location
    Brazil
    Posts
    5

    Default Form problem, Databind values using ajax proxy

    Hi Guys,
    I'm trying to load form using databind, in my viewmodel using static data, the form was loaded data corretly, but using ajax store do not work.
    What i need to do to load data using ajax proxy?


    Working
    Code:
    Ext.define('Myapp.view.TestesViewModel', {
                extend: 'Ext.app.ViewModel',
                alias: 'viewmodel.testes',
                data: {
                        "CORRETOR_ID": "24",
                        "NOME": "WAGNER NOGUEIRA",
                        "CPF": "12345678901",
                        "RG": null,
                        "PASSAPORTE": null,
                        "ENDERECO": "RUA TESTE",
                        "NUMERO": "100",
                        "COMPLEMENTO": "SL 101",
                        "BAIRRO": "TESTE",
                        "CEP": "12345-678",
                        "CIDADE": "TESTE",
                        "ESTADO": "11",
                        "NATURALIDADE": null,
                        "TELEFONE": "21 1234-56789",
                        "CELULAR": null,
                        "PROFISSAO_ID": "996",
                        "EMAIL": "[email protected]",
                        "DATA_NASCIMENTO": "05\/01\/1980",
                        "DATA_CADASTRO": "2017-12-06 20:09:28",
                        "STATUS": "A",
                        "ORGAO_ID": "2",
                        "ORGAO_ESTADO_ID": "7",
                        "ORGAO_NUMERO": "102030",
                        "CODIGO_PLANO": "1",
                        "VALOR_PLANO": "86,40",
                        "METODO_PAGAMENTO": "CREDIT_CARD",
                        "ORGAO": "CRECI",
                        "PROFISSAO": "CORRETOR",
                        "VALOR_PLANO_ORIGINAL": "8640",
                        "UF_SIGLA": "MG",
                        "PROXIMA_FATURA": null,
                        "CODE": "1",
                        "PARCELAS": "1 parcela",
                        "AMOUNT": "8640",
                        "PLANO": ""
                }
            });
    Not Working
    Code:
    Ext.define('Myapp.view.TestesViewModel', {
                extend: 'Ext.app.ViewModel',
                alias: 'viewmodel.testes',
                stores: {
                    corretores: {
                        autoLoad: true,
                        autoSync: true,
                        model: 'Myapp.model.cadastro.Teste',
                        proxy: {
                            type: 'ajax',
                            api: {
                                read: 'data1.json'
                            },
                            reader: {
                                type: 'json',
                                rootProperty: 'testes'
                            }
                        }
                    }
                }
            });
    data1.json

    Code:
    {
        "success": true,
        "total": "1",
        "testes": [{
                        "CORRETOR_ID": "24",
                        "NOME": "WAGNER NOGUEIRA",
                        "CPF": "12345678901",
                        "RG": null,
                        "PASSAPORTE": null,
                        "ENDERECO": "RUA TESTE",
                        "NUMERO": "100",
                        "COMPLEMENTO": "SL 101",
                        "BAIRRO": "TESTE",
                        "CEP": "12345-678",
                        "CIDADE": "TESTE",
                        "ESTADO": "11",
                        "NATURALIDADE": null,
                        "TELEFONE": "21 1234-56789",
                        "CELULAR": null,
                        "PROFISSAO_ID": "996",
                        "EMAIL": "[email protected]",
                        "DATA_NASCIMENTO": "05\/01\/1980",
                        "DATA_CADASTRO": "2017-12-06 20:09:28",
                        "STATUS": "A",
                        "ORGAO_ID": "2",
                        "ORGAO_ESTADO_ID": "7",
                        "ORGAO_NUMERO": "102030",
                        "CODIGO_PLANO": "1",
                        "VALOR_PLANO": "86,40",
                        "METODO_PAGAMENTO": "CREDIT_CARD",
                        "ORGAO": "CRECI",
                        "PROFISSAO": "CORRETOR",
                        "VALOR_PLANO_ORIGINAL": "8640",
                        "UF_SIGLA": "MG",
                        "PROXIMA_FATURA": null,
                        "CODE": "1",
                        "PARCELAS": "1 parcela",
                        "AMOUNT": "8640",
                        "PLANO": ""
                }]
    }
    Follow a example in fiddle to demonstrate:
    https://fiddle.sencha.com/#view/editor&fiddle/2aor

  2. #2
    Sencha User
    Join Date
    Aug 2017
    Location
    Brazil
    Posts
    5

    Default

    Please remove this post, was send twice, right post https://www.sencha.com/forum/showthr...ing-ajax-proxy

Similar Threads

  1. Databind problema using ajax proxy
    By digifarma in forum Ext JS 6.x Q&A
    Replies: 2
    Last Post: 11 Dec 2017, 10:37 AM
  2. Passing form values to Ext.Ajax.request
    By lukep1984 in forum Ext: Q&A
    Replies: 13
    Last Post: 10 Jan 2012, 3:02 AM
  3. databind form display in window
    By maren in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 4 Nov 2009, 2:13 AM
  4. ajax call and assign the values in form
    By ByteLess in forum Ext 2.x: Help & Discussion
    Replies: 15
    Last Post: 2 Jul 2009, 7:34 AM
  5. Image in form with databind?
    By nintondo in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 24 May 2009, 7:29 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •