Results 1 to 5 of 5

Thread: Error in rest proxy after build

  1. #1

    Default Answered: Error in rest proxy after build

    Hi,

    I have a aplication with a rest proxy. This works fine, but, when I do the build "sencha app build" and execute a build, I have an error when the store is instanciated:

    GET http://localhost:8080/SamosGaz/build...20151215154539 404 (Not Found) (index):111

    Uncaught TypeError: c is not a function (index):111

    When I set proxy as ajax, the problem is solved. But I need rest proxy.

    The store:

    Code:
    Ext.define('SamosGaz.store.consulta.VendasFaturamento', {
        extend: 'Ext.data.Store',
        model: 'SamosGaz.model.consulta.VendasFaturamento',
        alias: 'store.vendasfaturamento',
        remoteSort: true,
        groupField: 'SUBGRUPO_DESCRICAO',
    
    
        proxy: {
            type: 'rest',
            noCache: false,
            url: 'http://cambioparts.no-ip.info:8050/app/MyInterface/consultas',
            reader: {  
                type: 'json',
                rootProperty: 'result[0].rows',
                successProperty: 'result[0].success',
                totalProperty: 'result[0].total'
            } 
        }
    });
    The model:
    Code:
    Ext.define('SamosGaz.model.consulta.VendasFaturamento', {
        extend: 'Ext.data.Model',
        fields: [     
            "SUBGRUPO",           // "00001",
            "SUBGRUPO_DESCRICAO", // "EUROTECNICA",
            "GRUPO",              // "00004",
            "GRUPO_DESCRICAO",    // "CAIXA DE CAMBIO",
            "VENDAS_BRUTA",       //,
            "VENDAS_DEVOLUCAO",   // ,
            "VENDAS_LIQUIDA",     // ,
            "VENDAS_FRETE",       // 0,
            "VENDAS_OUTROS"     // 0,
        ]
    });
    The grid:
    Code:
    Ext.define('SamosGaz.view.consulta.vendasfaturamento.VendasFaturamento', {
        extend: 'Ext.ux.grid.Panel',
        xtype: 'vendasfaturamento',
        title: 'Vendas Faturamento',
        module: 'consulta',
    
    
        initComponent: function () {
            var me = this;
    
    
            Ext.apply(me, {
                features: [
                    {
                        ftype: 'groupingsummary',
                        groupHeaderTpl: '{name}',
                        hideGroupedHeader: true,
                        enableGroupingMenu: false
                    },
                    {
                        ftype: 'summary',
                        dock: 'bottom'
                    }
                ],
    
    
                columns: [
                    {
                        text: 'Ord',
                        align: 'center',
                        width: 50,
                        menuDisabled: true,
                        hideable: false,
                        renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
                            return rowIndex + 1
                        }
                    },
                    {
                        text: 'Descrio',
                        dataIndex: 'GRUPO_DESCRICAO',
                        flex: 1,
                        menuDisabled: true,
                        hideable: false,
                        summaryRenderer: function(value, summaryData, dataIndex) {
                            return '<strong>Total</strong>';
                        }
                    },
                    {
                        header: 'Vendas',
                        columns: [
                            {
                                header: 'Venda',
                                dataIndex: 'VENDAS_BRUTA',
                                xtype: 'moneycolumn',
                                summaryType: 'sum',
                                summaryRenderer: function(value, summaryData, dataIndex) {
                                    return '<strong>' + Ext.ux.String.toMoney(value) + '</strong>'
                                }
                            },
                            {
                                header: 'Devoluo',
                                dataIndex: 'VENDAS_DEVOLUCAO',
                                xtype: 'moneycolumn',
                                width: 110,
                                summaryType: 'sum',
                                summaryRenderer: function(value, summaryData, dataIndex) {
                                    return '<strong>' + Ext.ux.String.toMoney(value) + '</strong>'
                                }
                            },
                            {   
                                header: 'Lquida',
                                dataIndex: 'VENDAS_LIQUIDA',
                                xtype: 'moneycolumn',
                                summaryType: 'sum',
                                summaryRenderer: function(value, summaryData, dataIndex) {
                                    return '<strong>' + Ext.ux.String.toMoney(value) + '</strong>'
                                }
                            },
                            {
                                header: 'Frete',
                                dataIndex: 'VENDAS_FRETE',
                                xtype: 'moneycolumn',
                                width: 80,
                                summaryType: 'sum',
                                summaryRenderer: function(value, summaryData, dataIndex) {
                                    return '<strong>' + Ext.ux.String.toMoney(value) + '</strong>'
                                }
                            },
                            {
                                header: 'Outros',
                                dataIndex: 'VENDAS_OUTROS',
                                xtype: 'moneycolumn',
                                summaryType: 'sum',
                                summaryRenderer: function(value, summaryData, dataIndex) {
                                    return '<strong>' + Ext.ux.String.toMoney(value) + '</strong>'
                                }
                            }
                        ]
                    }
                ],
    
    
                tbar: [
                    {
                        fieldLabel: 'Data Inicial',
                        xtype: 'datesearch',
                        itemId: 'dataInicial',
                        value: Ext.ux.Date.firstMonthDate(),
                        listeners: {
                            change: 'setDataFinal'
                        }
                    },
                    {
                        fieldLabel: 'Data Final',
                        xtype: 'datesearch',
                        itemId: 'dataFinal',
                        value: Ext.ux.Date.lastMonthDate(),
                        listeners: {
                            change: 'setDataInicial'
                        }
                    },
                    '-',
                    {
                        xtype: 'button',
                        text: 'Pesquisar',
                        listeners: {
                            click: 'pesquisar'
                        }
                    }
                ],
            });
    
    
            this.callParent(arguments);
        }
    });
    What kind of config I have to do on rest in order to work ??
    Is it a bug?
    Thanks
    Albanir Neves

  2. Oh sorry, I didn't realize that is a Premium forum thread. To summarize, are you sure that you added the Ext.data.proxy.Rest class to your store's requires[] array?

  3. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Sounds like the same issue as this thread:
    https://www.sencha.com/forum/showthread.php?306596

  4. #3

    Default

    I tried to access but I have this message. How can I see that thread?

    albanirneves, you do not have permission to access this page. This could be due to one of several reasons:
    1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
    2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
    Thanks
    Albanir Neves

  5. #4
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Oh sorry, I didn't realize that is a Premium forum thread. To summarize, are you sure that you added the Ext.data.proxy.Rest class to your store's requires[] array?

  6. #5

    Default

    Oh, thats works now!

    Thanks
    Thanks
    Albanir Neves

Similar Threads

  1. How to handle rest error message from Model's proxy?
    By sergiomichels in forum Ext: Q&A
    Replies: 3
    Last Post: 2 Aug 2013, 9:00 AM
  2. With REST proxy in SA, wanting to catch error condition (not 200 status)
    By pkellner in forum Sencha Architect 2.x: Help & Discussions
    Replies: 5
    Last Post: 21 Mar 2013, 2:53 PM
  3. Rest Proxy 405 error
    By Simon C in forum Sencha Architect 2.x: Help & Discussions
    Replies: 3
    Last Post: 27 Aug 2012, 6:26 AM
  4. [FIXED] Store throwing an error when syncing with REST proxy
    By justinKohactive in forum Sencha Touch 2.x: Bugs
    Replies: 3
    Last Post: 6 Jan 2012, 9:56 AM

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
  •