Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5984289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:21:14+00:00 2026-05-22T22:21:14+00:00

For some reason, this configuration of an ExtJS4 grid won’t update. When you click

  • 0

For some reason, this configuration of an ExtJS4 grid won’t update. When you click on a cell, change a value, it hits the create URL, not the update URL, as defined in the proxy and observed with Firebug in FF4. Strangely, the datachanged event fires after loading the store when the page starts, but not after data has actually changed. Also, the grid send all rows to the create URL.

Can anyone tell me what I am doing wrong?

Ext.onReady(function() {

    Ext.BLANK_IMAGE_URL = '/images/extjs4/s.gif';
    Ext.tip.QuickTipManager.init();
    //Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider'));

    Ext.define('VendorError', {
        extend: 'Ext.data.Model',
        fields: [
            {name: 'UnexpSrvID', type: 'int'},
            {name: 'VendorID', type: 'int'},
            {name: 'VendorName', type: 'string'},
            {name: 'VndActID', type: 'int'},
            {name: 'VndActNb', type: 'string'},
            {name: 'InvoiceID', type: 'int'},
            {name: 'VInvNb', type: 'string'},
            {name: 'VInvRcptDt', type: 'date', dateFormat: 'Y-m-d' },
            {name: 'InvDate', type: 'date', dateFormat: 'Y-m-d' },
            {name: 'CodeSpecifier', type: 'string'},
            {name: 'Recurrence', type: 'string'},
            {name: 'ClientID', type: 'int'},
            {name: 'ClientName', type: 'string'},
            {name: 'LocID', type: 'int'},
            {name: 'LocName', type: 'string'},
            {name: 'RecentLocStatus', type: 'string'},
            {name: 'RecentLocStatusDate', type: 'date', dateFormat: 'Y-m-d' },
            {name: 'UnexpCost', type: 'float'},
            {name: 'ConfirmedAmt', type: 'float'},
            {name: 'StaffID', type: 'int'},
            {name: 'NetworkID', type: 'string'},
            {name: 'UnexpStatCode', type: 'string'}
        ],
        proxy: {
            type: 'ajax',
            simpleSortMode: true,
            api: {
                read: '/internal/viewVERext_json.asp',
                create: '/internal/viewVERext_create.asp',
                update: '/internal/viewVERext_update.asp',
                destroy: '/internal/viewVERext_destroy.asp'
            },
            reader: {
                type: 'json',
                totalProperty: 'total',
                successProperty: 'success',
                messageProperty: 'message',
                root: 'data'
            },
            writer: {
                type: 'json',
                writeAllFields: false,
                allowSingle: false,
                root: 'data'
            },
            listeners: {
                exception: function(proxy, response, operation){
                    Ext.MessageBox.show({
                        title: 'REMOTE EXCEPTION',
                        msg: operation.getError(),
                        icon: Ext.MessageBox.ERROR,
                        buttons: Ext.Msg.OK
                    });
                }
            }
        }
    });

    var store = Ext.create('Ext.data.Store', {
        model: 'VendorError',
        autoLoad: true,
        autoSync: true,
        pageSize: 20,
        remoteSort: true,
        listeners: {
        //  write: function(proxy, operation){
        //      if (operation.action == 'destroy') {
        //          main.child('#form').setActiveRecord(null);
        //      }
        //      Ext.example.msg(operation.action, operation.resultSet.message);
        //  }
            datachanged: function() {
                var report = "";
                store.each( 
                    function(rec) { 
                        report = report + rec.dirty + '/';
                    } 
                )
                alert(report);
            }
        }
    });

    // create the Grid
    var grid = Ext.create('Ext.grid.Panel', {
        store: store,
        //stateful: true,
        //stateId: 'stateGrid',
        columns: [
            {   text     : 'Vendor',
                dataIndex: 'VendorName',
                flex     : 1
            },
            {   text     : 'Account',
                dataIndex: 'VndActNb'
            },
            {   text     : 'Invoice',
                dataIndex: 'VInvNb'
            },
            {   text     : 'Invoiced',
                dataIndex: 'InvDate', 
                xtype    : 'datecolumn',
                align    : 'center'
            },
            {   text     : 'Receipted',
                dataIndex: 'VInvRcptDt', 
                xtype    : 'datecolumn',
                align    : 'center'
            },
            {   text     : 'Description',
                dataIndex: 'CodeSpecifier'
            },
            {   text     : 'Client',
                dataIndex: 'ClientName'
            },
            {   text     : 'Location',
                dataIndex: 'LocName'
            },
            {   text     : 'LStatus',
                dataIndex: 'RecentLocStatus',
                align    : 'center'
            },
            {   text     : 'Credit',
                dataIndex: 'UnexpCost',
                tdCls    : 'colyellow',
                renderer : Ext.util.Format.usMoney,
                align    : 'right',
                field    : { xtype:'textfield', allowBlank:false }
            },
            {   text     : 'Confirmed',
                dataIndex: 'ConfirmedAmt',
                tdCls    : 'colyellow',
                renderer : Ext.util.Format.usMoney,
                align    : 'right',
                field    : { xtype:'textfield', allowBlank:false }
            },
            {   text     : 'Recurrence',
                dataIndex: 'Recurrence',
                tdCls    : 'colyellow',
                align    : 'center',
                field    : {
                    xtype    : 'combobox',
                    typeAhead: true,
                    triggerAction: 'all',
                    selectOnTab: true,
                    store: [
                        ['once','once'],['1st','1st'],['2nd+','2nd+']
                    ],
                    lazyRender: true
                }
            },
            {   text     : 'CStatus',
                dataIndex: 'UnexpStatCode',
                tdCls    : 'colyellow',
                align    : 'center',
                field    : {
                    xtype    : 'combobox',
                    typeAhead: true,
                    triggerAction: 'all',
                    selectOnTab: true,
                    store: [
                        <%=cstat_grid%>
                    ],
                    lazyRender: true
                }
            },
            {   text     : 'Owner',
                dataIndex: 'NetworkID',
                tdCls    : 'colyellow',
                field    : {
                    xtype    : 'combobox',
                    typeAhead: true,
                    triggerAction: 'all',
                    selectOnTab: true,
                    store: [
                        <%=staff_grid%>
                    ],
                    lazyRender: true
                }
            }
        ],
        layout: 'fit',
        height: 500,
        renderTo: 'theGrid',
        selType: 'cellmodel',
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ],
        dockedItems: [
            {   xtype: 'pagingtoolbar',
                store: store,
                dock: 'bottom',
                displayInfo: true
            },
            {   xtype: 'toolbar',
                dock: 'top',
                items: [
                    { xtype:'button', 
                      text: 'IsDirty()', 
                      handler: function() { 
                        var report = "";
                        store.each( 
                            function(rec) { 
                                report = report + rec.dirty + '/';
                            } 
                        )
                        alert(report);
                        }
                    }
                ]
            }
        ],
        viewConfig: {
            stripeRows: true
        }
    });

    Ext.EventManager.onWindowResize(grid.doLayout, grid);
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:21:15+00:00Added an answer on May 22, 2026 at 10:21 pm

    Turns out the issue is that records added into the grid are detected as “not new” by the value of a unique id field. A kind poster on the Sencha forums pointed me to this.

    By default, this field in the model is expected to have a name of ‘id’. So, you must either provide a model with a field of ‘id’, which my model above did not have, or you must override the default column by using the idProperty property of Ext.data.Model. I simply renamed the UnexpSrvId column to id. And, lo and behold, we send updates to update() instead of create().

    This is not obvious from the API docs, as many things unfortunately are in this powerful framework.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With this configuration for some reason Conver function of Custom Converter is not called
For some reason This php script won't echo anything: <?php setcookie(pop,'hi',time()+604800); echo $HTTP_COOKIE_VARS['pop']; ?>
For some reason this isn't working, am I missing something obvious? RewriteRule ^(.*)infopopup.html$ /acatalog/infopopup.html
For some reason this line of code is giving me quite a problem. struct
For some reason this () character shows up in Firefox 10 randomly throughout my
For some reason this statement is working fine: vms.Where(vm => vm.MessageType == ValidationMessage.EnumValidationMessageType.Warning) But
For some reason this text isn't being centered. #highlightheader { background-color:#006600; color:white; font-size:30px; text-align:center;
For some reason this program is saying that 'switch' is not defined. What is
For some reason this function confused me: def protocol(port): return port == 443 and
For Some reason this query doesn't work in SSIS Select IDLOGARCHIVOS, NOMBREARCHIVO, FECHACREACION from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.